javakaffee

Just another weblog about (web) development technologies like spring, tapestry, jersey, jsf, hibernate and more

September 5, 2006

How to find memory leaks with tools of jdk 6 (formerly Mustang)

Filed under: development, java — martin.grotzke @ 3:15 pm

Adam Bien just posted a short how-to describing how to start finding memory leaks with JDK 6.

The short excerpt:
1. Start your java application with the additional parameter -agentlib:hprof=heap=dump,file=/tmp/hprof.bin,format=b,depth=10
2. Dump the heap into a file with jmap -dump:format=b,file=/tmp/java_app-heap.bin ${process-id}
3. Visualize the heap with jhat -J-Xmx326m /tmp/java_app-heap.bin. Jhat will start a web server at port 7000, so you can point your browser to http://localhost:7000 and start investigating.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image

Powered by WordPress