Garbage Collection Kick In Took So Long [Intermittent] - Stop-the-world

39 Views Asked by At

I ran an application using .NET in Raspberry Pi 4, I track the memory using DotMemory. I found interesting pattern.

No Unmanaged Memory Heap generation 0 Objects GC Times
1 134.25 495.9 7.3K 8 sec
2 134.21 647.7 8.4K < 1 sec

The data in No.1 -- Sometimes(occured 10 times @2 hour), the Garbage Collection Kick In took so long (Stop-the-world), I'm not sure what the root cause of the issue. The Objects and Heap Generation 0 is lower than No.2 which took only < 1 sec.

The Yellow Bar is GC Time

To reduce the issue, we make sure IDisposable object is disposed, reduce BeginScope log, etc. The behavior reduced from 10times@2hour to 5times@2hour. But we're still not sure what is the root cause why pattern No.1 exist in our dotMemoryProfiler.

We're trying to understand the root cause and reduce this pattern as much as possible.

0

There are 0 best solutions below