Prerequisites: Viewing performance bottlenecks
Performance bottlenecks can be quicklu identified by using the statistical views and the Method Invocation view. The following steps illustrate a workflow involved in identifying performance bottlenecks:
- Identifying the packages with a high execution time
- Identifying the classes within the package with high execution time
- Examining the methods within a class to identify high method invocations
Identifying the packages with a high execution time
- In the Profiling Monitor view, select the monitor or agent.
- Right click and select Open with > Package Statistics. The Package Statistics view opens.
- To analyze performance data, you want to look at the time related columns. In the Package Statistics view, right-click and select Choose columns.
- Select Base Time,Cumulative Time,Inherited Base Time and Inherited Cumulative Time.
- Click OK. The Package Statistics view is refreshed with the time columns.
- Sort the Base Time column by clicking on the column heading.
- Identify the package that has the greatest base time. Open the package tree.
- Identify the class or classes with the highest base time.
- Examine the performance within the classs identified in further detail using the Class Statistics view.
Identifying the classes within the package with high execution time
- Open the Class Statistics view by selecting the Class Statistics view icon in the toolbar. The Class Statistics view opens.
- In the Class Statistics view, select Choose columns.
- Select Base Time,Cumulative Time,Inherited Base Time and Inherited Cumulative Time.
- Sort the Base Time column by clicking on the column heading.
- Identify the class with the greatest Base Time and open the class tree.
- Examine which method calls within the class have the greatest Base Time.
Examining the methods within a class to identify high method invocations
The slow performance methods identified in the Class Statistics view can be examined in more detail to further pinpoint the source of the bottleneck using the Method Invocations view and table. This view will allow you to see the execution pattern and the differences between invocations of the same method.
To view the methods in the Method Invocation view,...
- To open the Method Invocation view, right-click on the class and select Show Method Invocation. The Method Invocation view opens.
- From the Method Invocation view, you can examine what called the invocation in the execution stack or you can jump to the source code of the method by right-clicking and selecting Show caller or Open source.
- You can also see the time spent by hovering the cursor over any bar.
- Open the Method Invocation table to get a tabular view of the same method. Right click in the Method Invocation view and select Show Invocation table. The Method Invocation table opens.
- Using both the Method Invocation view and the Method Invocation table, identify the differences between method invocations, and the method invocations that take the longest time to execute.
Related concepts
Overview of the Profiling ToolRelated tasks
Profiling an application
Launching or attaching a Java process