How do I run stand-alone Eclipse MAT?

ankitjaininfo picture ankitjaininfo · Aug 21, 2012 · Viewed 8.3k times · Source

I generated hprof using jmap.

sudo ~/jdk/bin/jmap -F -dump:file=app.hprof 5003  

Now, I am getting OOM / 'Java Heap Space' error while parsing *.hprof in eclipse. I think I need to run it as stand-alone.

How do I run it? any references?

Answer

npe picture npe · Aug 21, 2012

I assume, you've downloaded Eclipse MAT in the form of Standalone Eclipse RCP Application. If not - do so now, and extract the archive to a folder that suits you.

You're getting the OOME, because MAT has too few memory available (the heap-dump you're parsing is too big).

To make the heap bigger, edit your MemoryAnalyzer.ini file (it should be in your MAT directory), and add the following lines to it:

-vmargs
-Xmx2048M

The 2048M means 2 gigabytes of heap space will be available to the JVM. Perhaps 1 gigabyte will be enough for you.

Note! If you are using MAT as an Eclipse plugin, you can probably do the same trick by editing eclipse.ini in your Eclipse directory.