0

After I handle all memory leaks in my application I experience a time to time freeze , most of the freeze happens on weak PC's

I thinking it's exactly the time when GC starts to work.

can I monitor GC invoke time to be sure that that's the problem

Thanks.

Leon Barkan
  • 2,676
  • 2
  • 19
  • 43
  • Get dotTrace profiler and profile your app in "Timeline mode". It will show you all UI freezes and the root of them. https://www.jetbrains.com/help/profiler/Concurrency_Profiling_Timeline_.html – Ed Pavlov Jan 30 '18 at 15:41

1 Answers1

2

There are a number of performance counter related to GC: https://msdn.microsoft.com/en-us/library/x2tyfybc(v=vs.71).aspx

In your case, you should watch the value of # Gen 2 Collections and see if it increases when you experience the freeze. Note that it could also be gen 0 or 1 collections, but they're much less likely to cause a noticeable freeze.

Kevin Gosse
  • 38,392
  • 3
  • 78
  • 94
  • after the freeze, i supposed to see lass objects in the gen 2, it says that the GC worked on GEN 2 or I wrong? if I see more objects it's just because in the GC invoke the object that was in GC one didn't disposed – Leon Barkan Jan 30 '18 at 08:09
  • More objects? The performance counter gives the number of collection, not the number of objects – Kevin Gosse Jan 30 '18 at 11:45