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?
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?
You have to start the Java process with the correct arguments, which vary a little depending on the JVM version. Then, send a QUIT
signal to the process to generate a new file.
The output is normally generated when the VM exits, although this can be disabled by setting the “dump on exit” option to “n” (doe=n). In addition, a profile is generated when Ctrl-\ or Ctrl-Break (depending on platform) is pressed. On Solaris OS and Linux a profile is also generated when a QUIT signal is received (kill -QUIT pid). If Ctrl-\ or Ctrl-Break is pressed multiple times, multiple profiles are generated to the one file.
You can generate an hprof file on the fly using the jmap tool, which ships with Sun's Java VM:
jmap -dump:file=<file_name> <pid>