Aaron Digulla
Aaron Digulla

Reputation: 328536

Debugging Eclipse performance problems

To debug Eclipse performance problems, I created this .options file:

org.eclipse.jdt.ui/debug=true
org.eclipse.jdt.launching/debug = true
org.eclipse.jdt.launching/debug/classpath/jreContainer = true

# trace generation of type constraints and create toString info for debugging
org.eclipse.jdt.ui/debug/TypeConstraints=false

# timing output for code assist
org.eclipse.jdt.ui/debug/ResultCollector=false

org.eclipse.jdt.debug/debug=false
org.eclipse.jdt.debug/debug/jdiEvents=false
org.eclipse.jdt.debug/debug/jdiRequestTimes=false
org.eclipse.jdt.debug/debug/astEvaluations=false
org.eclipse.jdt.debug/debug/astEvaluations/callingThreads=false

# Turn on debug tracing for org.eclipse.jdt.core plugin
org.eclipse.jdt.core/debug=true

# Reports java  builder activity : nature of build, built state reading, indictment process
org.eclipse.jdt.core/debug/builder=true

# Reports java builder stats
org.eclipse.jdt.core/debug/builder/stats=true

# Reports compiler activity
org.eclipse.jdt.core/debug/compiler=true

# Turn on debugging for the org.eclipse.core.resources plugin.
org.eclipse.core.resources/debug=true

# Reports the start and end of all builder invocations
org.eclipse.core.resources/build/invoking=true

# Reports the start and end of build delta calculations
org.eclipse.core.resources/build/delta=true

# For incremental builds, displays which builder is being run and 
because of changes in which project.
org.eclipse.core.resources/build/needbuild=true

# Prints a stack trace every time an operation finishes that requires a 
build
org.eclipse.core.resources/build/needbuildstack=true

The file is in the same folder as eclipse.ini.

When I open the about dialog, I can see the option -debug in the eclipse.commands variable:

...
-product
org.eclipse.epp.package.jee.product
-console
-consoleLog
-debug
$HOME/tools/eclipse/kepler-SR2
-data
$HOME/workspace
-vm
$HOME/tools/java/jdk1.8.0_25/bin/java
...

(I replaced my home folder with $HOME for privacy reasons).

But I don't see any trace output in the console where I started Eclipse. I can see output from the m2e:

2015-01-19 17:04:46,892 [Worker-12] INFO  o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources.
2015-01-19 17:04:46,892 [Worker-12] INFO  o.e.m.c.i.embedder.EclipseLogger - Copying 1 resource

When I press Enter, I get an OSGi prompt.

But no trace of a trace output. What did I miss?

Upvotes: 1

Views: 718

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328536

When starting Eclipse with -debug, you can see which configuration files it loads during startup. The output looks like this:

...
Install location:
    file:$HOME/tools/eclipse/kepler-SR2/
Configuration file:
    file:$HOME/tools/eclipse/kepler-SR2/configuration/config.ini loaded
Configuration location:
    file:$HOME/tools/eclipse/kepler-SR2/configuration/
Framework located:
    file:$HOME/tools/eclipse/kepler-SR2/plugins/org.eclipse.osgi_3.9.1.v20140110-1610.jar
Framework classpath:
    file:$HOME/tools/eclipse/kepler-SR2/plugins/org.eclipse.osgi_3.9.1.v20140110-1610.jar
Splash location:
    $HOME/tools/eclipse/kepler-SR2//plugins/org.eclipse.platform_4.3.2.v20140221-1700/splash.bmp
Debug options:
    file:$HOME/tools/eclipse/kepler-SR2/.options loaded
Time to load bundles: 5
...

Note the last path which gives the debug options. In the case above, this was:

Debug options:
    file:$HOME/tools/eclipse/kepler-SR2 loaded

which is a folder ... Why would Eclipse do this? Because it was told so:

-debug
$HOME/tools/eclipse/kepler-SR2
-data

Notice the path between -debug and -data? Get rid of that and it will work (or specify the path to a real options file).

Upvotes: 1

Related Questions