Eclipse and SWT are very slow/hang on a fresh 16.04 install (gtk3/swt issue)

Bug #1552764 reported by Michael on 2016-03-03
454
This bug affects 92 people
Affects Status Importance Assigned to Milestone
java-common
New
Undecided
Unassigned
java-common (Ubuntu)
Undecided
Unassigned
openjdk (Ubuntu)
Undecided
Unassigned
swt-gtk (Ubuntu)
Undecided
Unassigned

Bug Description

I installed a fresh Ubuntu 16.04 64 bit from nightly build (2016-03-02).

Eclipse Mars.2 (4.5.2) is often very slow / hangs, especially on start of actions (searching projects, importing them, search for updates, install plugins etc.

Things I tried:
  * openjdk8 /oracle java 8
  * OS / CS nvidia driver
  * unity / gnome (metacity and compizz)
  * fresh workspace

jvisualvm shows that much cpu time is consumed by rg.eclipse.swt.internal.gtk.OS._g_main_context_iteration[native] ...

Michael (3-ueuntu-4) on 2016-03-03
summary: - Eclipse very slow on a fresh 16.04 install (gtk/swt issue?)
+ Eclipse is very slow/hangs on a fresh 16.04 install (gtk/swt issue?)
pagetronic (pagetronic) wrote :

Same problem, also on 4.5.0.

 Maven can't connect and SVN is very slow. Nothing to report, only java consideration.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in java-common (Ubuntu):
status: New → Confirmed
Changed in openjdk (Ubuntu):
status: New → Confirmed
Changed in swt-gtk (Ubuntu):
status: New → Confirmed
Michael (3-ueuntu-4) wrote :

The problem is indeed gtk(3). gtk2 works fine (can be forced the the environment variable export SWT_GTK3=0 - http://www.eclipse.org/swt/faq.php#gtkstartup) Additionally, this way I have no graphic errors any longer.

Franck (alci) wrote :

This is definitely a problem with SWT and the version of GTK3 that ships with 16.04.
the problem also arises with for example Gantproject (https://www.ganttproject.biz/download) or Digdash Studio (proprietary BI tool).

Exporting SWT_GTK3=0 works around the issue, but most SWT applications will fail by default on Xenial.

summary: - Eclipse is very slow/hangs on a fresh 16.04 install (gtk/swt issue?)
+ Eclipse and SWT are very slow/hang on a fresh 16.04 install (gtk3/swt
+ issue)
Willem Ligtenberg (wligtenberg) wrote :

I can also confirm this with another Eclipse Platform 4.5.1 based tool.
export SWT_GTK3=0 prior to launching will make it go away.

Orzech (porzechowski) wrote :

Another workaround is to append

--launcher.GTK_version
2

before

-vmargs

to eclipse.ini as mentioned here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=430736#c35.

kchan (lingaster) wrote :

same problem, 3 days ago i install a fresh ubuntu 16.04 xenial. Eclipse Mars 2 GUI hangs dramatically. As suggested export SWT_GTK3=0 works fine. BUT when i launch the debugger it still hangs. Please help?

giamma (gm-romanato) wrote :

As an alternative to exporting the variable, it is possible to add the following line to the eclipse.ini file:

--launcher.GTK_version 2

Genma (rickard-joh) wrote :

God dammit this bug ruined my day!

kchan (lingaster) wrote :

i've added
--launcher.GTK_version
2
to my eclipse.ini file too, everything is fine till i launch the eclipse java debugger, and there it hangs...

Larry D. James (ljames) wrote :

@kchan Try calling Eclipse from a script. I tested it and the debugger works using the environment variable.

Use a script such as:

myeclipse:

-------------------------------------------------
#!/bin/bash

export SWT_GTK3=0
/opt/eclipse/eclipse
-------------------------------------------------

kchan (lingaster) wrote :

Thinks Larry D. James, it works.

On the Ubuntu Mate I use, none of the solutions (system property and Eclipse.ini changes) seems working for some reason. Eclipse went slow till being unusable right after upgrade and now stays in this condition.

Matthew Dowell (mbd06b) wrote :

Audrius,

Just a suggestion, I had trouble too with the ini fix suggested.
--launcher.GTK_version
2
before vmargs in the eclipse.ini file

I had trouble because I wasn't amending the correct ini file. Some eclipse.ini files are buried in the system directory, and these are used to launch eclipse, even if your installed eclipse folder is elsewhere.
See>> http://stackoverflow.com/questions/8419099/where-does-eclipse-look-for-eclipse-ini-under-linux
to find other buried ini files to amend and see if that gets it working.

Robert Goley (ragoley) wrote :

This is frustrating. I have found not combination that will completely work. The SWT_GTK3=0 option helps a bit for basic Eclipse use/navigation but completely breaks JasperSoft Studio module. The JasperStudio report perspective hangs indefinitely when opening a jrxml file. Without the SWT_GTK=0 variable being set, the entire preferences window fails to redraw at all. I can force a redraw one time per entrace by doing a search after I have selected the item I want to see. The already finicky Ecipse 4.5.x UI becomes too unstable to use. Having to do things like minimize the entire window to see where it had already redrawn in the background but not actually on the screen. Please make this a high priority fix. Otherwise, 16.04 fails for a java development platform.

Robert Goley (ragoley) wrote :

Worth noting that Eclipse 4.6 (Neon) seems to work with all items that fail with 4.4.x/4.5.2 including JasperStudio Editor using GTK3. However, maven integration is broken in neon so I am still stuck. Hopefully comparision of the differences in swt-gtk from 4.5.2 to the current neon release will help in fixing for 4.5.2 as well.

information type: Public → Public Security
information type: Public Security → Public
Fabio (fabiofz) wrote :

As a note for those banging your head on the wall, switching to CentOS makes things much better related to Eclipse (also see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=492371)...

It'd be nice if Ubuntu could do some checking to make sure it doesn't break other apps with their customizations (although it seems there are some actions a user can do which can improve the situation: https://bugs.eclipse.org/bugs/show_bug.cgi?id=492371#c3).

demaniak (hendrikc) wrote :

The `export SWT_GTK3=0` trick seems to have sorted me out.

Jaspersoft Studio 6.3.1.final

LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Installing the plugin in Eclipse (Version: Neon.2 Release (4.6.2)) does not help for me.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.