69

List your favorite heap analysis tools (e.g. jprofiler, jmap, ...). Let's keep it one tool per answer, with a short list of pros and cons for each tool.

trincot
  • 317,000
  • 35
  • 244
  • 286
ripper234
  • 222,824
  • 274
  • 634
  • 905

4 Answers4

58

Eclipse Memory analyzer http://www.eclipse.org/mat/

dparnas
  • 4,090
  • 4
  • 33
  • 52
  • I know this is from '10, but anyone know what the tool to identify Memory Leaks was pointing to and what replaced it if anything? – Brian S Jun 24 '19 at 16:30
  • @GREnvoy the tool is called sap jvm profiler and you should be able to find some resources on google. Not sure if it's been replaced by a different tool – dparnas Aug 09 '19 at 11:47
  • is there a command line tools to detect if memory leak in the heap dump file? – Kevin Ding Sep 09 '22 at 03:02
35

Consider Java VisualVM, jvisualvm, included with the JDK. A pathologic Swing program is examined here. For a more recent perspective, see the Monitoring and Management Guide: Using JConsole regarding jconsole, also included with the JDK.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
28

YourKit : http://www.yourkit.com/

Pros:

  • The interface is clean and it's fast
  • It opened a large 5-gig heap dump where jProfiler grined to a halt. And it only needed 1-2 gigs of JVM ram to do so.

Cons: Of course... it's not free :(

ripper234
  • 222,824
  • 274
  • 634
  • 905
nanda
  • 24,458
  • 13
  • 71
  • 90
  • 1
    Well, just note that when trying to open a 20GB heap with YourKit it crashed on OOME, so YourKit won't help you by allowing you have open a large heap with a commodity Macbook Pro – Opster Elasticsearch Expert Feb 02 '16 at 16:23
5

BHeapSampler http://dr-brenschede.de/bheapsampler/

  • generates a class-level heap-graph as a really intuitive display of the dominant memory structures
  • can process really large heap dumps
  • command-line tool, usable on server side without transfering the dump to the developer's desk
Burak Kurkcu
  • 580
  • 5
  • 8
Arndt
  • 31
  • 1
  • 2
  • 4
    Closed source code and throws an strange exception with a.a() obfuscation. Looks like this tool is not working. – brummfondel Nov 27 '15 at 13:30