Notes on hprof

There are several ways to profile JVM, here is one way according to “Solaris Performance and Tools“:

-Xrunhprof:cpu=times,monitor=y,depth=8,file=path_to_result_file
Note:
monitor=y specifies that locks should be observed
msa=y turns on Solaris microstate accounting

depth=8 sets the depth of the stack displayed

To get an accurate profile you should run a kill -3 <pid> at the very beginning of steady state (i.e. after ramp up) to clear statistics collected on the initialization activities. Then, run a second kill -3 <pid> to generate the real profile at the very end of steady state (i.e. right before cool off state).

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s