Search code examples
javaeclipseeclipse-pluginequinoxeclipse-pde

Equinox launcher Main.run() called on each action


I have an eclipse based product (we've added a few of our plugins and packed it as a product).
We have some performance issues and unreasonable lock-ups.
During the investigation with YourKit Java Profiler, I noticed that on each performed action(expanding a folder, pressing a button, saving a file etc), the highest CPU load and the longest CPU usage is on a thread called main started from org.eclipse.equinox.launcher.Main.run(String[]) Main.java:1499.

The version of the org.equinox.launcher plugin is 1.4.0.v20161219-1356.

What is this thread, why is it always running(it's not a daemon thread and apparently it's live all the time)? What can I do about it?


Solution

  • That is the main Eclipse User Interface thread. It contains the SWT display 'readAndDispatch` loop which runs all user interface code.

    This thread is always running and there isn't anything you can do about that.

    If you are getting lockups and a lot of CPU in the UI thread it may be that some plugins are running code in the UI thread that should really be run in background threads. Long running code in the UI thread will make the UI unresponsive.