I looked over the documentation, but could not find an answer to my question. Does the number of Gen #2 instances reflect the number of objects ready for GC which survived Gen #0 and Gen #1? The reason I ask is that I’m seeing a lot of memory listed as Gen #2, and our application is having OOM issues. I’m wondering if there is a blocked finalizer not allowing for the Gen #2 memory to be cleaned up. Here is a screen shot of the profiler.
Thanks
Dan
Gen #2 instances question
-
- Posts: 1030
- Joined: Wed Mar 02, 2005 7:53 pm
Re: Gen #2 instances question
The number of gen #2 instances reflects the number of instances that have survived a gen #0 and gen #1 collection, but are still reachable from a root. So they are not eligible for garbage collection. Note that when you collect a full snapshot in the profiler, the profiler performs several full GCs in order to only present actual live instances. If you want to get information about unreachable instances, you can use the "Collect gen#0 snapshot" command instead (or attach to the process using "Inspection only attach"). This will prevent a full garbage collection from being performed and there will still exist unreachable instances in the heap (see screenshot).
Whether there are instances that are waiting to be finalized, or if there is a blocked finalizer, is not possible to determine from the screenshot. You can get more information about how the instances are kept alive by investigating the root paths of the instances (e.g. by investigating the Type details). If possible, I recommend that you run the profiled process under the profiler (e.g. by using "Profile application"). This way you will get much more detailed information, for instance information about potentially blocked finalizers.
Whether there are instances that are waiting to be finalized, or if there is a blocked finalizer, is not possible to determine from the screenshot. You can get more information about how the instances are kept alive by investigating the root paths of the instances (e.g. by investigating the Type details). If possible, I recommend that you run the profiled process under the profiler (e.g. by using "Profile application"). This way you will get much more detailed information, for instance information about potentially blocked finalizers.
Best regards,
Andreas Suurkuusk
SciTech Software AB
Andreas Suurkuusk
SciTech Software AB
Re: Gen #2 instances question
Thank you. I'm still learning about Garbage Collection and your tool.
Who is online
Users browsing this forum: No registered users and 16 guests