12
votes

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.

2
Isn't that what ParseHeapDump.sh does ? - Deepak Bala
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
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
jhat -port 7401 -J-Xmx4G <file> - bitsabhi

2 Answers

4
votes

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.

1
votes

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.