user331465
user331465

Reputation: 3094

Tool or tricks to analyze offline Java heap dumps (.hprof)

Are there any tools that allow offline analysis (including summary/sorting/sifting) of an .hprof file? Or can you run VisualVM, hat etc in batch mode?

I'm interested in something that can take an input .hprof file, crunch it and generate reports.

I assume you would need to pass in a bunch of options to configure the report, so if you know any helpful tips, please weigh in.

Preferably scriptable so I could run a bunch at once.

Upvotes: 26

Views: 63794

Answers (7)

Attila Csipak
Attila Csipak

Reputation: 1062

Also, if you use IntelliJ IDEA, you can open *.hprof memory snapshots, too: Run | Open Profiler Snapshot | Open

Official documentation: https://www.jetbrains.com/help/idea/analyze-hprof-memory-snapshots.html

Upvotes: 1

user2426263
user2426263

Reputation: 141

You can use jhat to parse/navigate the memory dump of an .hprof file.

$ jhat heapdump.hprof
Reading from heapdump.hprof...

Started HTTP server on port 7000
Server is ready.

The tool comes with the JDK.

Upvotes: 14

user85155
user85155

Reputation: 1380

Eclipse Memory Analyzer does everything you need.

Upvotes: 21

robbin
robbin

Reputation: 1944

JDK6 comes with jhat which parses and creates an html report.

http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html

Upvotes: 0

kohlerm
kohlerm

Reputation: 2624

Es MAT (http://www.eclipse.org/mat/) is the way to go. Check http://kohlerm.blogspot.com/search/label/memory, especially http://kohlerm.blogspot.com/2009/07/eclipse-memory-analyzer-10-useful.html

Upvotes: 0

james
james

Reputation: 1230

hard to beat yourkit java profiler. It costs money, but it is worth every penny.

Upvotes: 2

Peter Lawrey
Peter Lawrey

Reputation: 533492

Can you use jmap -histo ? What sort of report are you looking to extract?

Upvotes: 2

Related Questions