However, the information they provided was limited to a sorted list of method calls a program had called. The heap analysis tool, as its name implies, lets you analyze profile reports of the heap. The heap is a block of memory the Java VM uses when it is running. The heap analysis tool lets you generate reports on objects that were used to run your application. Not only can you get a listing of the most frequently called methods and the memory used in calling those methods, but you can also track down memory leaks.
Memory leaks can have a significant impact on performance.
The simplest report to generate is a text profile. To generate a text profile, run the application with the -Xhprof parameter. In the final release of the Java 2 platform software, this option was renamed -Xrunhprof . The following invocation creates a text output file that you can view without the heap analysis tool called java.hprof.txt when the program generates a stack trace or exits. A different invocation is used to create a binary file to use with the heap analysis tool.