Search code examples
javanetbeansprofiler

How do you find memory leaks using the Netbeans profiler?


I want to find memory leaks in my java application but I don't know how to use Netbeans profiler to do that.


Solution

  • There are several resources on the web that can give you a hand

    http://www.javapassion.com/handsonlabs/nbprofilermemory/

    http://www.netbeans.org/kb/articles/nb-profiler-uncoveringleaks_pt1.html

    http://kirk.blog-city.com/more_on_memory_leaks.htm

    In a nutshell, you monitor the "surviving generators", objects that are kept in the memory by your application.

    When you see that this metric gets out of hand, you can switch to the Memory Live profiling mode, sort the classes by surviving generators and then with the right click mouse button select the "Show Allocation Stack Traces" option