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).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s