Forum Visual Studio

The meaning of "Retained size"?

HaDoHaDo USUniversity

I'm trying to detect leaked memory by using Allocations Profiler. In my logs, there are some objects that had Live = 0 but still got some retained size > 0.

As in an older thread:

@RodrigoMoya said:

2) What is Retained column standing for? for some it is 0.

this is the size of the objects referenced by the selected allocation and all the references from those objects. That is, it means "amount of memory retained by this object". It's very useful to see if an object is the responsible for keeping a lot of objects in memory. Combined with the path to roots feature, it allows you to find possible leaks.

Does it mean even when my objects didn't live anymore, there was still something referenced from them?


  • izhangizhang USMember, Xamarin Team Xamurai

    This means the size of the object that was still retained after a garbage collection. You are correct, this usually means the object is still referenced in some way. This size is the amount that could be collected once the object is fully dereferenced.

Sign In or Register to comment.