Page 1 of 1

List of garbage collected instances

Posted: Mon Jun 22, 2020 12:33 pm
by MrKii
Hi! I'm evaluating the Memory Profiler, I think it's the most comprehensive .net memory profiler I've tested, so kudos for that :)

What I'd want to know is how can I inspect all the instances that where collected in a certain Garbage Collection (or between two snapshots).
I'm not interested in what's been allocated, only on what's been collected (in overview there's a "with new or removed instances", I suppose it'd be something like "with removed instances" only)

Is there any way to accomplish this?
Thanks!

Re: List of garbage collected instances

Posted: Tue Jun 23, 2020 3:09 pm
by Andreas Suurkuusk
It is currently not possible to get a list of garbage collected instances, but we're actually working on a feature that will make this possible. It's a four-way compare of snapshots, from up to two different sessions. With this comparison, full instance information will be available for two different snapshots and the profiler will be able to present information about instances that has been garbage collected. Unfortunately, this feature will not be available until version 6.0.

We will soon release version 5.7 of the profiler, but version 6.0 will not be released until later this year.

Re: List of garbage collected instances

Posted: Tue Jun 23, 2020 7:43 pm
by MrKii
Hi Andreas, thanks for your answer!

I think my question was not clear enough, or it didn't represent exactly what I was meaning (sometimes my english is quite bad).

I'm not specifically interested in the collected instances which are collected in a GC sweep. It would be nice to get them, and would solve my problem, but that's not what I really meant.

What I'd like to get is a list of instances (well, its stackframe) which are going to be garbage collected. Or in other words, capturing 2 snapshots, the list of instances that are in Snapshot #1 but are no longer in the Snapshot #2 (so are about to be collected in the next GC sweep).

I've been playing a little bit more with the profiler and I think I've narrowed the search a little bit. If I capture and compare two snapshots, go to overview and "with any allocation", on Live instances / Live bytes, sorting by "Removed" should show me what I'm searching, isn't it? They would be instances that were in Snap#1 but no longer are on Snap#2 , so are about to be collected sooner or later?

thanks!

Re: List of garbage collected instances

Posted: Wed Jun 24, 2020 1:18 pm
by Andreas Suurkuusk
I think we are meaning the same thing. I was also talking about getting a list of instances that existed in snapshot #1 and no longer exist in snapshot #2.

The "Removed instances" value does represent the number of these instances. However, if you look at the type details, you will not get a list with the removed instances. You can get a list with all live instances, or a list of all new instances, but no instance information is available for the removed instances (just a count). But, as I mentioned, in version 6.0, it will be possible to get a list of removed instances as well, with information such as the allocation call stack.

Re: List of garbage collected instances

Posted: Wed Jun 24, 2020 6:40 pm
by MrKii
Hi Andreas, thanks for the answer!

Yes, that's exactly what I meant, sorry I didn't understand it the first time. I'll be waiting for the 6.0 version ! :)

Regards