Free tools for analyzing heap usage, winner is Eclipse Memory Analyzer - No Fluff Just Stuff

Free tools for analyzing heap usage, winner is Eclipse Memory Analyzer

Posted by: Billy Newport on

I've been analyzing some heaps lately and am still very disappointed at the tooling for doing this kind of thing in Java. The first step is creating a heap dump. I am using a Sun Java 6 JVM so I used jmap to dump the heap.


The file was pretty big, 650MB. Next step is analyzing it. First attempt was to use jhat in the Sun JVM. This is pretty much useless. It just lets you walk the heap but I can't figure out how to get it to tell me which objects have the most instances etc. I don't see what that is useful for as a result.

Next was the IBM Alphaworks heap analyzer. First issue there was just loading the file. We failed to load it on our Laptops (4GB). Next I used one of my Mac Pros (32GB RAM) using a 64 bit JVM with a 16GB heap and now it loads but it was pretty buggy and was spitting exceptions in the console like nobodies business. We had a lot of trouble just getting it to respond to right clicks for displaying parents etc. So, this isn't great either.

Next, we downloaded the Eclipse Memory Leak Analyzer and this was the best of the lot by far and is what we're using now. You download this and it runs as it's own private eclipse instance. It loaded the file with no issues using defaults so this works on a laptop. It lets you get at all the information and doesn't spit exceptions at you so this is a huge (HUGE) step up on the Alphaworks heap analyzer. This is what we're using now for checking heap usage dumps.

We prefer a dump a file approach rather than live checking with commercial profilers just because it seems to be more stable. Attaching profilers seems to usually cause a crash etc so dumping the heap and then examining offline seems more useful.
Billy Newport

About Billy Newport

Billy is a Distinguished Engineer at IBM. He's been at IBM since 2001. Billy was the lead on the WorkManager/ Scheduler APIs which were later standardized by IBM and BEA and are now the subject of JSR 236 and JSR 237. Billy lead the design of the WebSphere 6.0 non blocking IO framework (channel framework) and the WebSphere 6.0 high availability/clustering (HAManager). Billy currently works on WebSphere XD and ObjectGrid. He's also the lead persistence architect and runtime availability/scaling architect for the base application server.

Before IBM, Billy worked as an independant consultant at investment banks, telcos, publishing companies and travel reservation companies. He wrote video games in C and assembler on the ZX Spectrum, Atari ST and Commodore Amiga as a teenager. He started programming on an Apple IIe when he was eleven, his first programming language was 6502 assembler.

Billys current interests are lightweight non invasive middleware, complex event processing systems and grid based OLTP frameworks.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »