To detect a memory leak, use the following scenario:
• Connect to profiled application
• “Advance generation number” just before executing the task which is suspected to cause leak.
• Let the application perform the task.
• Capture memory snapshot and open it.
• Use the “Generations” view to see objects created during the task execution; leaked objects should be among them.
potential leaks in particular profiled application are well known in advance, i.e. you know a class of objects that have a “tendency” to leak while application is being developed, changed, refactored. You can easily check for the presence of such objects, with the help of Memory (Go to Memory menu->Select Instances by Class option. In more complex cases, you can use” Set description language” in settings menu->Sets of objects option to declare sets of potentially leaked objects.
Once you have found leaked object(s), it’s time to understand why they are retained in memory:
Select the leaked object(s) in a memory menuPaths from GC Roots option.
To see leaked instance of class (Memory menu Instance by Class)
Leak detection: working with paths: