12

I was investigation with analyzing a HPROF file using Eclipse's Memory Analyser (MAT). The dominator tree, reports and the OQL interface look really useful. But all this has to be done manually from the MAT software.

Is there a commandline interface so I can programmatically parse the HPROF and automatically generate custom reports.

This would be useful to integrate this a test infrastructure to do a automatic memory analysis.

Btw, the heapsize is will be between 10-60MB.

Cœur
  • 32,421
  • 21
  • 173
  • 232
Abhishek
  • 1,669
  • 8
  • 26
  • 39
  • 1
    Isn't that what [ParseHeapDump.sh](http://wiki.eclipse.org/index.php/MemoryAnalyzer/FAQ) does ? – Deepak Bala Apr 12 '13 at 17:59
  • Yup, thanks for that. Did not know about it. Have a follow up question, How do you parse the index file that is generated? Want to run some custom analysis on it. – Abhishek Apr 12 '13 at 19:15
  • I'll move my comment to the answer's section since that was what you were looking for. If you elaborate on the custom analysis you're after, may be we can help. – Deepak Bala Apr 13 '13 at 09:46
  • jhat -port 7401 -J-Xmx4G – bitsabhi Sep 19 '18 at 07:29

2 Answers2

4

ParseHeapDump.sh does what you're looking for. As for the follow up question I'm not sure what format the index files are stored in.

Deepak Bala
  • 10,632
  • 2
  • 34
  • 48
  • Here is the custom analysis I want, By packagename heap utilisation, in a format which can be stored to a db or saved as a csv. – Abhishek Apr 13 '13 at 18:30
  • There is an export option on the dominator tree window that will allow you to export to `HTML` / `CSV` / `TXT`. I know that is not a direct answer to your question, but it is the best I have. The files can indeed be parsed on a command line to do what you're asking, but I do not know the technical path that will achieve that. – Deepak Bala Apr 14 '13 at 05:59
  • Tried ParseHeapDump.sh (ssh'd to big linux server), fails immediately with "Unable to initialize GTK+", looks like it thinks it's talking to a UI(??) – Charles Roth Apr 15 '16 at 19:39
1

See bitbucket.org/joebowbeer/andromat, which is adapted from bitbucket.org/ekabanov/mat, which is a stripped-down command line version of Eclipse Memory Analyzer.

Joe Bowbeer
  • 2,641
  • 2
  • 27
  • 42