Eclipse getting closed regularly - eclipse

I have a machine with 2GB of RAM.
Currently, my Eclipse is getting closed regularly after throwing:
Unhandled event loop exception
PermGen space
Some times it gets closed without showing any error, or some other errors.
Here is the setting that I have in eclipse.ini:
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms256m
-Xmx384m
What changes do I need to make to fix this?

Add at the end of your eclipse.ini file this line:
-XX:MaxPermSize=256m

Thanks a lot.I made it 512 and got it worked.

Related

Eclipse: java.lang.OutOfMemoryError: Java heap space

I am using Eclipse 4.4.1 and i always encounter this error, i can not work with eclipse.
Is there any way to fix it?
My eclipse.ini:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
2048m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:+UseParallelGC
-XX:PermSize=512M
-XX:MaxPermSize=2048m
-Xms512m
-Xmx2048m
Exception stack trace:
java.lang.OutOfMemoryError: Java heap space
at org.eclipse.ui.part.ResourceTransfer.nativeToJava(ResourceTransfer.java:162)
at org.eclipse.swt.dnd.Clipboard.getContents(Clipboard.java:330)
at org.eclipse.swt.dnd.Clipboard.getContents(Clipboard.java:241)
at org.eclipse.ui.internal.navigator.resources.actions.PasteAction$1.run(PasteAction.java:192)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4590)
at org.eclipse.ui.internal.navigator.resources.actions.PasteAction.updateSelection(PasteAction.java:186)
at org.eclipse.ui.actions.BaseSelectionListenerAction.selectionChanged(BaseSelectionListenerAction.java:124)
at org.eclipse.ui.internal.navigator.resources.actions.EditActionGroup.updateActionBars(EditActionGroup.java:153)
at org.eclipse.ui.internal.navigator.resources.actions.EditActionGroup.fillActionBars(EditActionGroup.java:99)
at org.eclipse.ui.internal.navigator.resources.actions.EditActionProvider.fillActionBars(EditActionProvider.java:49)
at org.eclipse.ui.navigator.NavigatorActionService$3.run(NavigatorActionService.java:259)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.navigator.NavigatorActionService.fillActionBars(NavigatorActionService.java:253)
at org.eclipse.ui.navigator.CommonNavigatorManager.selectionChanged(CommonNavigatorManager.java:222)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:163)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2171)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1202)
at org.eclipse.ui.navigator.CommonViewer.handleSelect(CommonViewer.java:478)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1231)
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:236)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:408)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)
Session data:
eclipse.buildId=4.4.1.M20140925-0400
java.version=1.7.0_71
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product
I noticed this behavior after i installed https://extensions.gnome.org/extension/779/clipboard-indicator/. Do you also have this extension installed? When I disable this extension (and restart gnome-shell) the exception in Eclipse is gone. Can you confirm this?
I have made a bug report here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=449902.
You don't say how much memory you have on your computer, but you are very likely specifying overly large memory requirements.
Check this excellent answer:
What are the best JVM settings for Eclipse?
Per your settings, I believe you would need 1GB of free memory to start, and could use much more than that if loading a large project.
If that does not help, then I also noticed that the exception is occurring in a method that would appear to be related to clipboard transfer. Is it possible you have a very large data set in your clipboard? That's just a guess and I don't know why Eclipse would want to transfer data from the clipboard on load.

Eclipse Timeout Error from the debugger?

I am using Eclipse to develop Android apps. Things seem to run along smoothly while I'm debugging and then Eclipse seems to hang up - a "Not Responding" error. I looked in the log files and I get this timeout error every 3 seconds. Anyone else seen this?
I have to keep restarting my machine.
!ENTRY org.eclipse.jdt.debug 4 125 2014-03-12 10:18:19.417
!MESSAGE Internal error logged from JDI Debug:
!STACK 0
org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 12963.
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186)
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226)
at org.eclipse.jdi.internal.VirtualMachineImpl.classesBySignature(VirtualMachineImpl.java:638)
at org.eclipse.jdi.internal.VirtualMachineImpl.classesByName(VirtualMachineImpl.java:667)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.jdiClassesByName(JDIDebugTarget.java:1596)
at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.filterUnloadedTypes(JavaHotCodeReplaceManager.java:348)
at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.notifyUnsupportedHCR(JavaHotCodeReplaceManager.java:379)
at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager$2.run(JavaHotCodeReplaceManager.java:322)
at org.eclipse.debug.core.DebugPlugin$AsynchRunner.run(DebugPlugin.java:1068)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.debug.core.DebugPlugin$AsynchRunner.async(DebugPlugin.java:1051)
at org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(DebugPlugin.java:405)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!SESSION 2014-03-12 10:30:21.771 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64
I suggest you clean up your eclipse using terminal
Mine directory
cd /Applications/eclipse_juno/Eclipse.app/Contents/MacOS
Clean command
./eclipse -clean
OR
Open up eclipse.ini in your eclipse folder.
Change this line
-Xms512m
-Xmx1024m
into this
-Xms768m
-Xmx768m
eclipse.ini
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=192m
-Xms768m
-Xmx768m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
If still happen, restart your machine.
http://blog.revivalx.com/2014/03/15/your-eclipse-always-crash-how-to-fix-and-enhance-to-do-list/
You can increase a value of debugging time out in Eclipse.
Go to Window/Preferences. In the Java/Debug you'll see Debugger Time out parameter.
You need to run -clean, then use Task Manager (in Windows) to stop adb.exe. Once you do this, things run smoothly.
Unselect Window->Preferences->Java->Debug, "Suspend execution on uncaught exceptions"
Try this for eclipse
Menu -> Run-> Remove All BreakPoints

Eclipse hang after import google play library

I've import google play service library in one of my app and now my eclipse hang and go out of memory when I try to run only this app.
There aren't error messege before launch and I've just tried few time but without success.
Eclipse show me this message:
Unable to execute dex: Java heap space
Conversion to Dalvik format failed: Unable to execute dex: Java heap space
After increasing memory in eclipse.ini as is indicated in various posts, I obtain this new error:
Unable to execute dex: GC overhead limit exceeded
GC overhead limit exceeded
Here my eclipse.ini:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms1024m
-Xmx1024m
-XX:-UseCompressedOops
-Dorg.eclipse.swt.browser.DefaultType=mozilla
Can someone help me?
I've no idea how solve this issue...
You have to edit the -XmsAm and -XmxBm parameters manually from the eclipse.ini file to increase memory. Here try this.
https://stackoverflow.com/a/6024262/2896954

Eclipse startup Error code=1?

I just downloaded eclipse-java-helios-SR2-win32-x86_64.zip extracted the zip.
When i'm trying to run i get error:
Here is my .ini file:
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
I'm runing on Windows 7 64bit (Yes i downloaded the 64bit JDK and 64bit Eclipse)
The JVM being used by Eclipse for startup is somehow C:\Windows\system32\javaw.exe. I do not think that this what you intended to use.
To specify the JVM to be used by Eclipse, add the following line to the eclipse.ini file:
-vm <location of javaw.exe of your JAVA_HOME>
The above line would ideally have to be present before the line where your vmargs are specified.
I just had this problem after updating from Java 7u17 to Java 7u21. I first tried editing eclipse.ini, but that did't work. I then re-downloaded and re-installed the JRE and then it worked!
I'm guessing the JRE install was somehow corrupted, and so Eclipse tried to use the fallback jvm of C:\Windows\System32\java.exe
Hope this helps others with the same issue.
You are trying to run using a JRE instead of a JDK. Download the latest JDK from Sun (oops I mean oracle):
http://www.oracle.com/technetwork/java/javase/downloads/index.html
And run with that instead.
Maybe you can try to set the following arguments smaller.
--launcher.XXMaxPermSize
256M
-Xmx384m
Don't know why, but it works for me .
Is there any chance that you have Quick Test Professional installed? If so, check this out:
https://issuetracker.springsource.com/browse/STS-2828
I was getting the same error, tried several recommendations and none worked. When I try to check my java version, I get something like this:
Picked up JAVA_TOOL_OPTIONS: -agentlib jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\
bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar
Error occurred during initialization of VM
Could not find agent library jvmhook on the library path, with error: Can't find
dependent libraries
In my case it was caused by a user environment variable that QTP put in my user profile. Someone asked a similar question over on Software Quality Assurance and Testing. He had success by removing the environment variables. When I removed the environment variables, I got Eclipse to work, but QTP is having some problems.
*Update: The problems I was having with QTP seem to have been because I was trying to log in while the nightly regression tests were running and all the available licenses were being used. I am now able to use either program with no issues.
It looks like the application is defaulting to the system32 java application.
You can change it by making sure that your PATH variable in the system environment is set properly to point to the correct version of java(64 bit jdk\bin) version.
Make sure that the shortcuts in C:\Program Data\Oracle\Java point to the correct version of java. If not fix the target location. (if you cannot fix the locations in the shortcut properties, delete the shortcuts and create a new one with the same name)
Note that Program Data is a hidden folder.

Eclipse fails to start on Windows if -Xmx option is specified a higher value

I'm running inside a VM. In the VMWare settings, I can see that the RAM alloted is 6016 MB which is 6GB.
As recommended in our company I used -Xmx1024m (the default was 512) but eclipse fails to start, saying jvm exit code -1. The maximum value for Xmx that works is 660m. Why is this happening? Please help before I shoot myself.
Edit: I'm able to run a Helloworld java program specifying the option -Xmx1024m. Only eclipse cribs during starting.
You need to make sure that your OS and JVM are both 64-bit. In a 32-bit environment virtual memory address space fragmentation can result in relatively small contiguous memory blocks being available.
If you have to stay with 32-bit OS, then try adding the following to the start of your eclipse.ini file:
-vm
[some.path]/javaw.exe
You may also want to try disabling any devices that aren't strictly required as that will load fewer drivers into the address space and cause less fragmentation.
Try running with parameters -Xms1024M -Xmx6016M
Here Xms is the initial heap memory at startup and xmx is total heap memory that can be allocated. You can increase or decrease heap memory depending on your project and objects size.
Can you please try with -Xmx1024m and -Xms512m. Somtimes if the difference between maximum and minimum heap space size is too large it affects eclipse startup.
Ok Now,
Remove all the Windows java files from the System32 directory and install the latest jdk from sun. Then start the Eclipse, it will run I hope.
After removing it may ask for the latest jdk/jre. So set the path to include jre in JDK. And run it.
Using the Android bundle version - adt-bundle-windows-x86-20130219
I had the same issue with the virtual machine failing to start. I reduced the mem max (running in a VM as well xp x86). I found this thread and modified the config and it worked for me. The VM ram was 1.7gb, upped to 2.1 with no change.
I changed the eclipse.ini setting from
-Xmx768m
to
-Xmx512m
and it started straight away.
I left the min at 40m and the other settings were unchanged.
Heres the full config:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-product
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
-Declipse.buildId=v21.1.0-569685