Cant detect memory leak with ANTS memory profiler

1.2k views Asked by At

I have a custom application that allows to open some custom models. If I open a model in the application, then open another model - memory isn't released from the first model.

When I try to profile memory leak with profiler (ANTS memory profiler), the application releases memory and I'm not able to track the leak. How can I manage this problem? Memory usage chart from profiler

1

There are 1 answers

0
CharithJ On BEST ANSWER

When you take a snap shot ANTS memory profiler does a full garbage collection.

When you want to take a snapshot, I normally take 2-3 snapshots until there is not memory differences between two consecutive snapshots. Then compare with your base snapshot.

Go to instance list and see if there is any instances are growing. Select the Objects with Source in order to get rid of heaps of system object.

If there is any growing instances, pick one and see the objects retention graph which will show you exactly which instance holds the reference.

And also, make sure that you have implemented IDisposable properly and dispose all disposable objects and unsubscribe from all event subscriptions.

Have a look at below walkthroughs

http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/walkthrough http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/