Checking that a memory leak is fixed
Published 17 December 2012
This page outlines how to check that a memory leak you previously identified is now fixed:
- Repeat the steps you used to find the memory leak. If you are looking for a particular class or object, switch to the Class List, and use the find box to locate the class or object in which you are interested.
- If you have fixed the leak, the objects should not be in memory.
If an object is unexpectedly still found in memory, there are two main likely causes:
- The object might be on the finalizer queue. To check, display the object on the instance retention graph, and view objects on the finalizer queue by clearing the Hide finalizer queue GC roots option on the bar above the graph. If your object is on the finalizer queue, take another snapshot and check again: the object may be removed when the garbage collector runs.
- The object may still be held in memory on a different path. The instance categorizer only shows retention along the shortest path. If your object was being kept in memory on more than one path, you may have to break references on these other paths, too.