Finding a Period of Inefficient CPU Usage

See Also

To find a period of time in which the CPU or CPUs are not always running in user mode, you can use the Samples bars in the Timeline tab. The samples show a color-coded representation of the amount of time spent in each microstate. The color code is displayed in the Event tab in the right pane. By default User CPU time is coded green. The data in the samples includes all LWPs, so if your application creates more LWPs than there are CPUs, the samples will only have a fraction of their area colored green for the times when the application was running at 100% CPU efficiency.

  1. Scan the Samples bar for a sample that shows significantly less than 100% User CPU time.
  2. Select the sample and look at its details in the Event tab.

    The details show how much time is spent in each microstate. You can use this information to decide whether to investigate further.

  3. Filter the data to display information only for this sample.

    Choose View and choose Filter Data and select the experiment and sample number.

Now that you have found a region that you are interested in, you can use one of the following methods to locate the function that is responsible for the problem.

Now that you have located a function that might be the cause of the problem, you can examine the annotated source code or annotated disassembly code to find the source lines or instructions that are responsible for the high metric value. See Finding Problem Points in Your Program for more information on how to do this.

See also
The Timeline Tab
The Event Tab
The Legend Tab

Can't find what you are looking for? Submit your comments at http://www.sun.com/hwdocs/feedback.
Legal Notices