19

I just upgraded my Ubuntu to 14.04 a few days ago and in the process switched from 32 to 64 bits. Ever since, Eclipse has gotten really unstable. After having run for a few minutes it will start randomly freezing for longer and longer periods of time, particularly on code completion (already had to disable that), but also on cut/pasting, occasionally on saving, and sometimes for no apparent reason at all. During the freezes it pumps both CPUs to 100%. Sometimes it then comes back as if nothing had happened, sometimes it'll spout errors about being out of memory, timing out or exceeding the GC overhead.

I've already increased its Xmx to 2GB as suggested in any thread dealing with this issue here on SO, but it hasn't helped. Actually, none of the things suggested in them have.

I'm running Kepler with Nodeclipse, Android Developer Tools, Subversive and SQLExplorer. That exact setup worked flawlessly before the upgrade.

Can anyone confirm this issue or (hope dies last) suggest a fix? If anyone else has this too I'll file a bug.

UPDATE

I have downloaded an x86 version of Eclipse as well as Oracle Java 8 and any missing libraries it was complaining about when starting, and this has proven a lot more stable. It still freezes on content assist, but other than that, it seems stable so far. So it must definitely be some kind of issue with the 64 bit version.

To sum up all the things already tried and uneffective at this point:

  • Increased memory to 2GB through Xmx setting in eclipse.ini
  • Added -Dorg.eclipse.swt.browser.DefaultType=mozilla to eclipse.ini
  • Different JVMs: OpenJDK 7, Oracle Java 7 and 8
  • Fresh install of Eclipse

I have now filed a bug on bugs.eclipse.org: bug report

UPDATE 2

It seems that ever since having installed the 32 bit version of Eclipse (which I have long since deleted again), the 64 bit version is also running more stable. This doesn't really make sense to me, but over the last few days, it hasn't frozen up once. Can anyone confirm?

Never mind...it's still doing it :(

Also, for anyone else having this problem, I'd appreciate it if you could post 'me too' on the bug report on bugs.eclipse.org as it has gotten zero attention there so far.

UPDATE 3

Some more things I have tried without success:

  • Added -Dorg.eclipse.swt.browser.XULRunnerPath=/dev/null to eclipse.ini as per https://bugs.eclipse.org/bugs/show_bug.cgi?id=404776#c22
  • Switched to different themes
  • Ran with environment variable GDK_NATIVE_WINDOWS=true
  • Ran with environment variable LIBOVERLAY_SCROLLBAR=0
  • Disabled "mark occurences" feature

UPDATE 4, after a long long time

Apparently this is not a bug in Eclipse itself, but in JSDT. According to the bug report, it's fixed for version 3.7, which, after an install of the new Eclipse Mars, I cannot confirm - it's just as bad as ever. But since, from some other bug, the new Eclipse is now constantly running my CPU at 100% (bad for battery life, that...), I have decided to move away from using it for my JavaScript projects, at least for a while.

Question: Can anyone suffering from this bug confirm it disappeared with JSDT 3.7?

UPDATE 5, after a LONGLONGLONGLONG time

Since this question apparently keeps being visited by people I want to give a final update. The bug finally started getting attention a while back, the first two updates however didn't fix the issue for me (and apparently some other people). As Eclipse was entirely unusable for Javascript development in its current state, I finally gave up on it. People are still complaining about this on the bug report, however, so I'm assuming it's still not fixed. I am now using Sublime Text - quite happily, but also with a twinge of sadness. I really liked Eclipse. If this issue ever goes away for good, I'd appreciate to hear about it.

BadIdeaException
  • 2,125
  • 15
  • 32
  • Did you upgrade Eclipse to a 64 bit distribution – apesa Apr 24 '14 at 14:40
  • Yes, I did. Clean install on everything, too. – BadIdeaException Apr 24 '14 at 14:42
  • What JVM, OpenJDK?? have you tried another JVM? This problem is usually related to the SWT native library used by Eclipse for it's UI which makes it a mix of native library / Java code. You probably have a mix of 32 and 64 bit native library support left behind from the move from 32 to 64 bit platform. – apesa Apr 24 '14 at 14:50
  • Yeah it's OpenJDK. OpenJDK did the job just fine before, so I wasn't really expecting issues from it... Downloading the Oracle one as we speak, I'll see if that does it. I clean-installed everything, full OS wipe, new eclipse, JVM and plugins...where could the leftovers be? – BadIdeaException Apr 24 '14 at 14:58
  • what does xxx$ java -version output – apesa Apr 24 '14 at 15:00
  • I just switched it over to Oracle JDK 1.8, if that doesn't work, I'll try their 1.7. Currently it says `java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)` – BadIdeaException Apr 24 '14 at 15:10
  • Okay, I just tried both Java 8 and 7 and then invoked content assist, both froze. `java -version` for Java 7 gives `java version "1.7.0_55" Java(TM) SE Runtime Environment (build 1.7.0_55-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)` – BadIdeaException Apr 24 '14 at 15:17
  • My comment on leftover libs has more to do with how you upgraded. Looks like yours is not an upgrade but a new install. So forget about that. I have not run 14.04 yet but I am certain you have a library mismatch or a bug in a native support lib for sure. I would stay on Java 8 and not 7 and would look for other 14.04 specific issues on AskUbuntu. Sorry I can't help without 14.04 insight – apesa Apr 24 '14 at 15:22
  • No prob, thanks for all the time you took so far. Do you think this is a 14.04 issue or a 64 bit issue? – BadIdeaException Apr 24 '14 at 15:24
  • So I now have 64 bit 14.04 running with Eclipse Kepler 64 bit and Android ADT 4.4.3. I went to git and cloned a repo I have and it builds fine, no frozen screens or hang ups. I have had it running for most of the day. I looked around and found this on askubuntu http://askubuntu.com/questions/26632/how-to-install-eclipse . Look at the eclipse.desktop part as well as the other steps. This may be your problem. I will say that each time I install Ubuntu I immediately patch it and install development tools like build-essential etc. which will/may update some libraries. – apesa Apr 24 '14 at 20:55
  • 1
    I have same problem on ubuntu studio 14.04 with latest adt bundle. – daniel Apr 24 '14 at 21:57
  • You should look on askubuntu. This is almost definitely a SWT native library issue and has to do with how you install and configure Eclipse. You might try Googling "debugging eclipse" and go that direction to get an idea of what library may be failing. – apesa Apr 25 '14 at 02:40
  • @apesa Ok, I'll poke around on AskUbuntu and ubuntuusers and see if there's anything. I'm sort of wondering if it's JSDT related, actually (been using Nodeclipse when it happened, haven't actually been on ADT for a while), if it's not too much to ask, could you run a quick try with a JavaScript project and see if you experience freezing? – BadIdeaException Apr 25 '14 at 08:42
  • @daniel Do you have any JavaScript projects in your workspace that might be getting rebuilt by JSDT? I'm starting to suspect it's a JSDT problem. – BadIdeaException May 13 '14 at 07:03
  • No, I also noticed that changing theme more likely increases crash chance, i mean I have installed KDE-desktop and for gtk theme it use oxygen-gtk, then eclipse crashes sometime , I chose the theme for gtk to its default of UbuntuStudio xfce's, and there is no problem for now and it is working nicely, so make sure you chose different themes and restart pc to see effects. – daniel May 13 '14 at 09:16
  • Tried your suggestion of choosing different themes, but unfortunately it didn't work. Thanks anyways. – BadIdeaException May 15 '14 at 09:49
  • Just got new hardware (Dell Precision 3800) and installed Ubuntu 14.04 and I'm also experiencing all kind of missbehaviours/freezes/crashes of Eclipse Kepler. Haven't found any solution either. – pakman Aug 22 '14 at 16:36

4 Answers4

6

Had the same problem for a few days. Added the following line in the end of eclipse.ini and it solved for me:

-Dorg.eclipse.swt.browser.DefaultType=mozilla
Pedro Casagrande
  • 167
  • 2
  • 14
  • 1
    This fix is for older Eclipse not Kepler. In any case even with that I'm also getting freezes and crashes with Kepler and Ubuntu 14.04. – pakman Aug 22 '14 at 16:37
  • @pakman Has theses crashes started a few days ago after an upgrade. I started to experience these kind of crashes again. The above answer had solve the crashes some months ago. – Pedro Casagrande Aug 22 '14 at 18:53
  • It is a brand new computer (Dell precision m3800) with a brand new installed ubuntu 14.04 (with all updates to date). Previously I was using debian 7 with no problems (on another comp). – pakman Aug 22 '14 at 19:29
  • I have also added -XX:MaxPermSize=512m and this seems to fix the freezes – Dmitry Dec 31 '14 at 09:47
1

Had the same problem and Lars' article solved it for me. Seems to be an issue with SWT and GTK3.

ftl
  • 3,014
  • 1
  • 24
  • 25
  • thank you! that solved the problem. Just updated to Ubuntu 16.04 and STS (Spring Tool Suite - Eclipse) started to freeze when creating classes, running tests, etc. Solved! – Salvatorelab Apr 22 '16 at 14:33
0

I faced the same problem and still face it. though the frequency is somewhat become lesser after I increased JVM size in the file "eclipse.ini" just change these lines:

-XX:MaxPermSize=256m
-Xms256m
-Xmx2048m

and start Eclipse from terminal :~/Desktop/eclipse$ ./eclipse

It will decrease the frquency of freezing if not resolve it completely. Hope it helps.

Neelam
  • 360
  • 4
  • 14
-1

Update

https://bugs.eclipse.org/bugs/show_bug.cgi?id=404776

There are a couple of workarounds in the comment thread. Folowing to the comment 22, I've added this to my eclipse.ini.

-Dorg.eclipse.swt.browser.UseWebKitGTK=true
-Dorg.eclipse.swt.browser.XULRunnerPath=/opt/xulrunner/1.8.0.1/xulrunner

I had installed xulrunner into this directory for some reason, don't know why exactly this version.


This is not really an answer but I need the space for pasting in the data of my system config. Just for comparison, hope it helps.

I have this same problem when I work on PHP projects, and it annoys me too: Sometimes eclipse 4.3 crashes on Ubuntu 14.04 64-bit when I hit the keystroke combination for content assist / autocompletion (Shift+Space). Happened on 13.10 as well.

I have no clue what migtht cause the error. However, I noticed that my system has very little free memory. Moreover the JAVA_HOME variable pointed to an older path of the JRE.

Maybe Alt-F2 and typing unity --replace & helps. Alternatively maybe you can send a HUP signal to com?piz

My eclipse configuration

(beginning of Help/About Eclipse/Installation Details/System Configuration:

 eclipse.buildId=4.3.2.M20140221-1700
eclipse.commands=-os
linux
-ws
gtk
-arch
x86_64
-showsplash
/opt/eclipse/eclipse43jee//plugins/org.eclipse.platform_4.3.2.v20140221-1700/splash.bmp
-launcher
/opt/eclipse/eclipse43jee/eclipse
-name
Eclipse
--launcher.library
/opt/eclipse/eclipse43jee//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212/eclipse_1508.so
-startup
/opt/eclipse/eclipse43jee//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.appendVmargs
-exitdata
e5000d
-product
org.eclipse.epp.package.jee.product
-vm
/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java
eclipse.home.location=file:/opt/eclipse/eclipse43jee/
eclipse.launcher=/opt/eclipse/eclipse43jee/eclipse
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2/
eclipse.p2.profile=epp.package.jee
eclipse.product=org.eclipse.epp.package.jee.product
eclipse.startTime=1398324869065
eclipse.vm=/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java
eclipse.vmargs=-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni
-Dhelp.lucene.tokenizer=standard
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx3072m
-jar
/opt/eclipse/eclipse43jee//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
equinox.use.ds=true
file.encoding=UTF-8
file.encoding.pkg=sun.io
file.separator=/
gosh.args=--nointeractive
help.lucene.tokenizer=standard
http.nonProxyHosts=
http.proxyHost=127.0.0.1
http.proxyPort=8118
http.proxySet=true
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.awt.printerjob=sun.print.PSPrinterJob
java.class.path=/opt/eclipse/eclipse43jee//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
java.class.version=50.0
java.endorsed.dirs=/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/endorsed
java.ext.dirs=/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext
java.home=/usr/lib/jvm/java-6-openjdk-amd64/jre
java.io.tmpdir=/tmp
java.library.path=/usr/lib/x86_64-linux-gnu/jni
java.runtime.name=OpenJDK Runtime Environment
java.runtime.version=1.6.0_31-b31
knb
  • 9,138
  • 4
  • 58
  • 85
  • Hi, on what kind of project does this happen to you? (E.g. java, javascript, php, ...) – BadIdeaException Apr 25 '14 at 12:51
  • php- I'll add this to my "answer". – knb Apr 26 '14 at 11:07
  • Does your php project have any JavaScript parts in it that the JSDT compiler might be running over? Because I'm beginning to suspect it's a JSDT issue, not SWT... – BadIdeaException May 13 '14 at 07:01
  • it is a xulrunner issue. I've added a few more lines to my eclipse.ini file. I'll update my answer once again. It seems to be Eclipse Bug 404776, see comment 22 https://bugs.eclipse.org/bugs/show_bug.cgi?id=404776 and related comments. – knb May 13 '14 at 07:10
  • Unfortunately, that has not helped either. I'm officially mystified. – BadIdeaException May 14 '14 at 11:16