VContainer icon indicating copy to clipboard operation
VContainer copied to clipboard

How to track when objects are resolved/created in order to find memory leaks?

Open mike-odom opened this issue 6 months ago • 0 comments

We're seeing a fair amount of "Leaked Managed Shells" when looking at the Unity Memory Profiler and we're trying to figure out where they are coming from. How do we track GameObjects and other objects that are created and still hanging out in memory after the container is destroyed?

We'd like to create a list of WeakReferences of any objects created and then be able to output that debug info. Is there a way in VContainer to tie into when an object is resolved/created? I can create a resolver, but I think that would have to be added to every single .Register call.

Or is there a better way to do this with the DiagnosticsCollector?

mike-odom avatar May 28 '25 17:05 mike-odom