Profilers typically collect large amounts of data from the application being monitored. Users must choose profiling options and filters carefully in order to have an effective profiling session. This document describes some of the ways users can speed up profiling with TPTP's Java profiler.
Proper filtration can significantly speed up a profiling session. Follow the steps below to change the filtering criteria used by TPTP's profiler:
- Click on the profile button and select 'Open Profile Dialog...' as indicated in figure 1.0
- Select the desired launch configuration to the left
- Select the 'Monitor' tab as indicated in figure 1.1
- The filter page can be accessed by either double clicking on 'Java Profiling' or by selecting 'Java Profiling' and clicking on 'Edit Options'
- Once this is done, the user is presented with the filter page indicated in figure 1.2. This page can be used to specify filters by using class names, method names, and a visibility rule. The * (asterisk) wildcard can be used for the class and method names to select multiple classes/methods. There is no need to specify method
signature in the method name column.
- The filters page should be used to exclude classes that are irrelevant in a profiling session. The best approach is by including the packages that should be profiled and excluding everything else. For example, if all classes that are to be profiled have the prefix 'org.mypackage', then the following filtering criteria can be used:
Class Method Name Rule org.mypackage* * INCLUDE * * EXCLUDE
Note that the filter list is order-dependent. Filters higher in the list take precedence over filters lower in the list.
Figure 1.0: Profile list
Figure 1.1: Profile launch configuration
Figure 1.2: Filters page
Selecting fewer profiling options can significantly speed up profiling. Here are the steps to alter the profiling options used by TPTP's profiler:
- Follow steps 1-3 in section 2.0 (Profiling Filters) to get to the screen in figure 1.1.
- The entries displayed under 'Java Profiling' are the profiling options that are available to the user. The settings for each profiling option can also be altered by selecting it and clicking on 'Edit Options'.
- Select 'Execution Time Analysis' and click on 'Edit Options'.
- The 'Show execution flow graphical details' option under 'Type of data' can significantly slow down profiling. This option requires graphical details to be collected in the model and rendered in the UI. By selecting the 'Show execution statistics (compressed)' option, the profiler will default to an aggregated mode, which will significantly speed up profiling.
- Collecting instance level information when profiling with either Memory Analysis or Execution Time Analysis can also slow things down.
The biggest overhead in TPTP is on the workbench side
(specifically the loaders/model). As a last resort, users can choose to profile to a file instead of sending profiling data directly to the workbench. Users can then import this file on a faster machine for analyzing the profiling data or analyze the data manually by opening it in a text editor. To send profiling data to a file, follow the steps given below:
Another way to profile to a file is to run an application in standalone mode. On Java 1.5 or higher, this can be done by running the command:
On Java 1.4.x or lower, this can be done by running the command:
Please see the 'Getting started with Agent Controller' document listed in the documentation page of TPTP for more information.
- Follow steps 1-2 of section 2.0 (Profiling Filters)
- Select the 'Destination' tab
- Select 'Send profiling data to a file'
- Specify a file with .trcxml file extension as indicated in figure 1.4.
- Click on profile to start profiling to a file. The file generated can later be imported into the workbench by right clicking in the 'Profiling and Logging' perspective -> selecting Import... -> Profiling and Logging -> Profiling file -> Next -> Selecting the profiling file -> Specifying the type of data that should be imported in the 'Range' tab -> clicking on finish.

Another way to profile to a file is to run an application in standalone mode. On Java 1.5 or higher, this can be done by running the command:
java -agentlib:JPIBootLoader=JPIAgent:server=standalone,file=<filename>;<profiler> <Java_app to be profiled>
On Java 1.4.x or lower, this can be done by running the command:
-XrunpiAgent:server=standalone <VM argument>
Please see the 'Getting started with Agent Controller' document listed in the documentation page of TPTP for more information.
When using the Java profiling agent on Java 1.4.x and lower, you can also control profiling speed by specifying profiling limits:
- Follow steps 1-4 in section 2.0 (Profiling Filters) to get to the following screen:
- Click on next to get to the screenshot indicated in figure 1.5
- This page can be used to halt profiling after a certain number of method invocations or after a certain amount of time.

Figure 1.5: Filters page

Figure 1.5: Profiling Limits
In order to have an effective profiling session users must be cautious with the profiling filters and options that they use. Users have the power of specifying what should be profiled as well as how the profiling data should be presented. It's easy for a profiling session to consume a lot of data and hog all the system resources. The methods outlined in this document try to avoid such cases with TPTP's Java Profiler.