5 Profiling Applications
HPjmeter allows you to process profile data from Java virtual machines.Separating the profile data collection step from the analysis step has the following advantages:
•The data analysis can be done at a different time and on a different platform than was used to run the application. For example, it can be done on a desktop system or on a laptop.
•A
•The profile data files obtained naturally facilitate comparison of different runs or creation of a history of performance improvements.
The
For best results when using the
How to tell when the thread timing data is off: Because Java can generate an eprof data file with no errors or other indication of a problem in this situation, you may not know the file is inaccurate until you try to open it with HPjmeter. Then, HPjmeter will either refuse to load the file, or it will load the file, but display unusual results.
If HPjmeter refuses to load the file, it will display an error message such asNumber format error at line NNN. Cannot continue.If HPjmeter does load the file, you will see unexpected and inaccurate results in the metric displays. The unexpected results can be seen most easily by examining the Threads Histogram. If you see many threads spending all their time in an unexpected state, such as "Unknown" or "Lock Contention", then you are experiencing the problem with inaccurate data. Update your Java installation to one of the versions mentioned above to correct the problem.
Although many features of HPjmeter are available only when
This guide also presents information on running the JVM with
Profiling Overview
Profiling an application means investigating its runtime performance by collecting metrics during its execution. One of the most popular metrics is method call count - this is the number of times each function (method) of the program was called during a run. Another useful metric is method clock time - the actual time spent in each of the methods of the program. You can also measure the CPU (central processing unit) time, which directly reflects the work done on behalf of the method by any of the computer's processors. This does not take into account the I/O, sleep, context switch, or wait time.
58 Profiling Applications