Home Tutorials Training Consulting Products Books Company Donate Contact us

Get more...

Training Events

Tracing Eclipse components. This article describes how to trace and perform performance analysis on Eclipse plug-ins and RCP applications.

1. Eclipse Performance

This article gives pointers how to analyze Eclipse performance issues.

2. Monitoring the interactive UI performance with the UI freeze monitor

The Eclipse IDE includes an interactive UI performance measurement feature. If activated, a stack trace is written to the Error view, in case a UI freeze occurs.

You can activate this tracing via Window  Preferences  UI Responsiveness Monitoring

Monitoring the interactive UI performance

3. Using the build-in tracing facilities of Eclipse

3.1. Using tracing for your IDE

Eclipse provides a tracing facility which can be activated on demand. If activated, additional plug-in informations are written to the console at runtime.

You activate tracing via the -debug start parameter.

Eclipse looks now, by default, for a file called .options in the Eclipse install directory. The file must contain one key=value pair per line.

If the plug-in prepared that you can see the tracing option in the preference settings. It is also possible to active these tracing options at runtime. The Eclipse IDE preferences as depicted in the following screenshot.

Enable Tracing at runtime.

These tracing options are also available for a launch configuration.

3.2. Example: Tracing the startup time of plug-ins

In this example you will trace the start time of each plug-in during startup. For this, create a .options in your Eclipse installation directory with the following content.

# turn on debugging for the org.eclipse.core plugin.
# turn on execution time of the activator for the plug-ins
# turn on total execution time of the plug-ins

Start Eclipse via the following command line.

./eclipse -debug

You can also specify the location of the options file as a URL or a file-system path after the -debug argument.

In this example the Starting application timestamp describes when OSGi is done with its initialization. The Application Started tells you when the application has been started. Afterwards you can extract the information which interest you the most. For the above example, the following is a small shell script this extracts the time of the activator of each bundle . It also sorts the bundles by this time.

# start Eclipse with at test workspace while piping the output into a file
./eclipse -debug -data ~/test > trace.txt
# get total start time
echo "" >> tracefinal.txt
echo "Total startup time" >> tracefinal.txt
grep "for total start time" trace.txt  | awk '{print $1 " " $13}' | sort -nr >> tracefinal.txt
echo "" >> tracefinal.txt
echo "Activator times" >> tracefinal.txt
# extract the activation time
grep "to load and start the activator" trace.txt  |awk '{print $1 " " $9}'| sort -nr >> tracefinal.txt

3.3. Example: Tracing the resource plug-in

The following is another example for an .option file in which you trace the resources.

# turn on debugging for the org.eclipse.core.resources plugin.

# monitor builders and gather time statistics etc.

# monitor resource change listeners and gather time statistics etc.

# monitor workspace snapshot and gather time statistics etc.

# monitor workspace snapshot and gather time statistics etc.

# debug build failure cases such as failure to retrieve deltas.

# reports the cause of autobuild interruption

# reports the start and end of all builder invocations

# reports the start and end of build delta calculations

# for incremental builds, displays which builder is being run
# and because of changes in which project.

# prints a stack trace every time an operation finishes that requires a

# prints a stack trace every time a build API method is called

# report debug of workspace auto-refresh

3.4. Implement tracing for your plug-in

Can you also implement tracing for your custom plug-in, see Using Eclipse Tracing API. To add your tracing options to the preference preference page, to allow users to turn them on at run time, use extension point the org.eclipse.ui.trace.traceComponents. See TracingPreferencePage for the implementation of this.

3.5. Example: Tracing for key bindings

The tracing functionality of Eclipse allows to you trace which command is associated with a certain key binding. The following listing contains the trace options to enable that.

# turn on debugging for the org.eclipse.core.resources plugin.

4. Performance traces

The Eclipse platform supports the creation of performance traces via the PerformanceStats class. See Gathering performance statistics for more details.

5. Automated tests

The Eclipse project supports automated tests to continuously run benchmarks.

6. Eclipse Sleak

Eclipse Sleak monitors the creation and disposal of SWT graphics resources. Get it from the SWT Development Tools or install the Eclipse Plugin via the SWT Tools Update Sites.

To activate Sleak, you can use the Tracing tab in your Eclipse runtime configuration.


Alternatively you can also activate it for your Eclipse IDE. For this you have to start Eclipse with the -debug option from the command line. You also need to create a .options file in the Eclipse installation directory with the following entries.


If you start your Eclipse IDE, you find the Sleak view under Window  Show View  Other …​  SWT Tools  Sleak.

Sleak allows you to take a snapshot and create a diff. Clicking on Stacktrace gives you the stacktrace in which the resource was allocated.

7. Yourkit

7.1. What is Yourkit

Yourkit is a commercial tool for performance tracing and analysis. You require a license to use it but Yourkit offers free licencses to Open Source projects.

To install Yourkit, you need to download if from Yourkit download. Depending your platform you can the installer (Windows) or extract the compressed archive to your system.

On Linux extract it to a folder of your choice. In this folder you find the script bin/yjp.sh to start Yourkit. The Yourkit tooling starts and ask you for the license key and with which IDE it should integrate.

To trace IDE tools like Eclipse you need to remove the filter flag.

yourkit ide tracing

8. Java Mission Control

Java Mission Control is set of tools to perform performance analysis of a Java application.

9. Eclipse tracing and performance tools resources

10. vogella training and consulting support

Copyright © 2012-2019 vogella GmbH. Free use of the software examples is granted under the terms of the Eclipse Public License 2.0. This tutorial is published under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany license.