Can I generate an HPROF file at will?

Nick Stinemates picture Nick Stinemates · Feb 26, 2010 · Viewed 34.2k times · Source

I have a java process which is acting dubiously. I'd like to see what's up using the various HPROF analysis tools.

How do I generate one on the fly?

Answer

user297529 picture user297529 · Mar 19, 2010

Yes. You can generate an hprof file (containing heap memory usage) on the fly using the jmap tool, which ships with Sun's Java VM:

jmap -dump:file=<file_name> <pid>