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

Bug #1552764 reported by Michael
470
This bug affects 95 people
Affects Status Importance Assigned to Milestone
java-common
New
Undecided
Unassigned
java-common (Ubuntu)
Confirmed
Undecided
Unassigned
openjdk-9 (Ubuntu)
Confirmed
Undecided
Unassigned
swt-gtk (Ubuntu)
Confirmed
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)
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?)
Revision history for this message
Michael (3-ueuntu-4) wrote : Re: Eclipse is very slow/hangs on a fresh 16.04 install (gtk/swt issue?)
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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)
Revision history for this message
Huck-bernhard (huck-bernhard) wrote :
Revision history for this message
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.

Revision history for this message
Orzech (piotr.orzechowski) 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.

Revision history for this message
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?

Revision history for this message
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

Revision history for this message
Genma (rickard-joh) wrote :

God dammit this bug ruined my day!

Revision history for this message
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...

Revision history for this message
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
-------------------------------------------------

Revision history for this message
kchan (lingaster) wrote :

Thinks Larry D. James, it works.

Revision history for this message
Audrius Meskauskas (audrius-meskauskas) wrote :

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.

Revision history for this message
Michael Vorburger (mike-vorburger) wrote :
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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).

Revision history for this message
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.

Revision history for this message
luoyang (497670157-o) wrote :

I use ubuntu16.04 desktop amd64, install vivado2016.3.
When I run '/opt/Xilinx/SDK/2016.3/eclipse/lnx64.o/eclipse', it appears the following error, and exited.
How can I find the problem according to the info?
######################
JVM terminated. Exit code=6
/usr/lib/jvm/java/bin/java
-Xms64m
-Xmx512m
-jar /opt/Xilinx/SDK/2016.3/eclipse/lnx64.o//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /opt/Xilinx/SDK/2016.3/eclipse/lnx64.o//plugins/com.xilinx.sdk.product_1.0.0.201610110148.jar/splash.bmp
-launcher /opt/Xilinx/SDK/2016.3/eclipse/lnx64.o/eclipse
-name Eclipse
--launcher.library /opt/Xilinx/SDK/2016.3/eclipse/lnx64.o//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.300.v20150602-1417/eclipse_1612.so
-startup /opt/Xilinx/SDK/2016.3/eclipse/lnx64.o//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.overrideVmargs
-exitdata 22b0014
-vm /usr/lib/jvm/java/bin/java
-vmargs
-Xms64m
-Xmx512m
-jar /opt/Xilinx/SDK/2016.3/eclipse/lnx64.o//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
#############################

I have soure the needed env:
#############################

export JAVA_HOME=/usr/lib/jvm/java
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

# xilinx
export XILINXD_LICENSE_FILE=/opt/Xilinx/Vivado_license_2037_2016.3.lic
alias vivado='/opt/Xilinx/Vivado/2016.3/bin/vivado'
source /opt/Xilinx/Vivado/2016.3/settings64.sh
export SWT_GTK3=0
if [ -n "${LD_LIBRARY_PATH}" ]; then
    #export LD_LIBRARY_PATH="/opt/Xilinx/Vivado/2016.3/lib/lnx64.o:"$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH="/opt/Xilinx/SDK/2016.3/lib/lnx64.o:"$LD_LIBRARY_PATH
else
    #export LD_LIBRARY_PATH="/opt/Xilinx/Vivado/2016.3/lib/lnx64.o"
    export LD_LIBRARY_PATH="/opt/Xilinx/SDK/2016.3/lib/lnx64.o"
fi

###############################

Mathew Hodson (mhodson)
affects: openjdk (Ubuntu) → openjdk-9 (Ubuntu)
To post a comment you must log in.
This report contains Public information  
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.