问题
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.
回答1:
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
回答2:
Had the same problem and Lars' article solved it for me. Seems to be an issue with SWT and GTK3.
回答3:
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.
回答4:
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
来源:https://stackoverflow.com/questions/23271877/eclipse-kepler-freezes-on-64-bit-ubuntu