Random Errors and crashes in Eclipse - Galileo 3.52
I've been using Eclipse - 3.52 Galileo - for Android work. That's the version my project group is using so I don't have the option of using a different one. My PC in XP Pro, SP3.
Mostly it works fine but it crashes several times a day - maybe 3 crashes in a 10 hour workday. Usually the crashes happen in the middle of something mundane like editing files and Eclipse either freezes or just disappears, along with the eclipse.exe process.
I also get random errors in the error log but they happen regardless of whether there are any crashes! These are just a couple of examples but I get maybe 1 or 2 an hour regardless of crashes . . .
Exception launching the Eclipse Platform:
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.core.runtime.internal.adaptor.EclipseAdaptorMsg at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:202) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at . . .
...N.B. Eclipse seemed to launch OK despite that error!
Error Wed Nov 24 23:04:26 EST 2010 Unhandled event loop exception
java.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) at 开发者_运维技巧 java.lang.ClassLoader.defineClassCond(Unknown Source) . . .
I get that error a lot. I don't seem to be out of memory - Task Manager says I'm using about 900M on a 2G PC.
I've reinstalled Eclipse once with no improvement. I run dozens of other apps on my PC including Visual Studio, Photoshop, various video and audio editors, etc, and none of them crash or freeze.
Any suggestions? Thanks in advance!
I hate to answer my own question but someone might be looking for an answer in a search and I've got one now.
I was using Java 6u21 and it turns out there's an incompatibility with that and Eclipse that results in out-of-permgen-memory errors. According to one Eclipse website "According to one explanation, "the vendor was changed from Sun to Oracle. Eclipse launcher reads the JVM vendor and if it detects a Sun JVM, it adds an extra –XX:MaxPermSize setting that is necessary for Eclipse to function. With the vendor change in 6u21, the launcher is no longer adding the necessary parameter on launch"
I upgraded to 6u22 and the problems vanished.
you should set enough memory in eclipse.ini file and if you use virtual machine, set enough memory in VM parameters as here
精彩评论