When I downloaded the Git project OsmAnd and went to compile it,
Eclipse returned these errors:
[Dex Loader] Unable to execute dex: GC overhead limit exceeded
[OsmAnd] Conversion to Dalvik format failed:
Unable to execute dex: GC overhead limit exceeded
Google and Stackoverflow said that I must change -Xms40m -Xmx384m in eclipse.ini.
Conversion to Dalvik format failed: Unable to execute dex: Java heap space.
I cleaned project and restarted Eclipse, but it did not help.
I found this link: Tips for Android developer: “Conversion to Dalvik format failed: Unable to execute dex: null”
But I do not know which .jar from my project to change the input in.
If anyone can help, I can send the project to them.
It can be fixed by changing the VM values in Eclipse.ini. Set the values to 512 and 1024 as below:
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx1024m
The changed area in image
For me following steps worked
1) Open eclipse.ini file
2)changed
-Xms40m
-Xmx512m
to
-Xms512m
-Xmx1024m
3)Restart eclipse
See here
eclipse.ini look like this.
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-Xmx1024m
Let me assume this problem caused due to the Android XML, because of very frequently you're opening it
These following two issues on StackOverFlow are realted with each other:
Every time I click on an Android XML file in Eclipse, it loads data for all API versions
and
Unable to execute dex: GC overhead limit exceeded
I found one more solution to resolve this problem other than increasing the VM values or downgrading to an older ADT version (22.6.2 or 23.2)
Note:
Some of the older ADT versions which won't load the XML each and every time you open so there is no memory overflow to cause this GC overhead limit exceeded as discussed on the first thread
Solution:
At the bottom of the eclipse there will be Trash can symbol which states Run Garbage Collector. Whenever you close an XML file of android don't forget to just click on the Trash Can or Run Garbage Collector to release memory. This way you can protect the workspace from crashing this kind of error :D
This could be an ultimate solution because you can't increase the VM value beyond your RAM limit if you very frequently open your android XML especially if you do lot of UI works like me :P
I hope this would help everyone who will come to this thread :)
Keep Calm and Code On
After 12 hours with this error and no success with changing the eclipse.ini file I finally found the correct solution. In my environment variables there was a variable named "_JAVA_OPTIONS" containing the value "-Xmx512M". Changing this value to the same value as in eclipse.ini (-Xmx4096M) I was once again able to export my project to an APK file.
I DO NOT know the reason behind this work-around, but it works for me all the time when all of the above don't.
Do not start eclipse from a short-cut or a link. Always open it from the eclipse.exe in your eclipse folder, the very folder which holds the eclipse.ini
Note - I tried only for linux.
To avoid this annoyable message, i had to change my configuration as follows:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-
144807
-product
com.android.ide.eclipse.adt.package.adtproduct
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms512m
-Xmx1024m
based on the answer marked as correct, changing
-XX:MaxPermSize=256m
-Xms512m
-Xmx1024m
and:
--launcher.XXMaxPermSize
1024m
1) Open eclipse.ini file
2)change
-Xms40m
-Xmx512m
to
-Xms512m
-Xmx1024m
3)Restart eclipse
The same eclipse.ini file will be located in Eclipse in this root path of eclipse itself like:
C:\Users\username\Downloads\adt-bundle-windows-x86_64-20140702\eclipse\eclipse.ini
The same file will be located in android studio project:-
C:\Users\username\AppData\Local\Android\sdk\tools\lib\monitor-x86_64\monitor(Type:Configuration settings)
If these answers don't work (They didn't for me) then try this:
1) Make a copy of your .metadata folder in your workspace.
2) Delete your .metadata directory AFTER MAKING A COPY
3) Open Eclipse and close Eclipse.
4) Copy your plugins folder from your old .metadata to your new .metadata
5) Import all the projects back into your workspace
6) Keep Calm and Code On!
Related
I don't know whats wrong with my eclipse. its running so slow.
it takes at least 10 minutes to open. when Start server it is also taking long time.I tried multiple way.
I am on Windows 7,
eclipse LUNA (4.4.0)
I am using maven and spring framework and running jboss server.
I have 8 GB of RAM.
my eclipse.ini look like that
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
1024M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms1024m
-Xmx1024m
I have changed Xms and Xmx value from
-Xms128m
-Xmx128m
to this
-Xms1024m
-Xmx1024m
But I am having the same issue,
It was working fine but after few days it become slower and slower.
Please help.
Add -Xverify:none to your eclipse.ini file.
It will cut down your Eclipse startup time considerably.This will tell the VM not to validate all the .class files it is loading
try removing unwanted plugins from the eclipse.. since these plugins cause unnecessary memory consumption you will definitely see some improvement. I have faced this issue, after removing some plugins,my eclipse got real faster..
You can try the Eclipse plug-in 'Optimizer for Eclipse'. It really helped me to boost my Eclipse start-up.
It can update your settings by itself (change heap size, suggest the latest eclipse/jdk version, and more).
Link : https://zeroturnaround.com/free/optimizer-for-eclipse/
Disable unwanted plugins during startup.
I was using Eclipse Luna + ADT, everything was fine, but today, when I try to run my project in my cel, it freezes to 99%, and then says:
Unable to execute dex: GC overhead limit exceeded
and then :
Unhandled loop expected
The only solution I find is go back to ADT Bundle ( w/ Kepler), but I don't love this solution as Eclipse is very outdate...
Any help will be appreciated
This Link Helped me a lot.
As what is said in the link above, you should increase the size of memory used by eclipse.
Just open the eclipse.ini file, located in the same folder as eclipse.exe is located by a text editor.
The original eclipse.ini file looks like this:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
Now change the last 2 lines to:
-Xms512m
-Xmx1024m
You can also increase the value of MaxPermSize, as the following:
-XX:MaxPermSize=1024m
This solution helped me and solve my problem.
Good luck
I'm using eclipse to develop android application and it always gone well, but today it's giving problems.
When i try to open eclipse it show me this message "Failed to create the java virtual machine. Error occurred during initialization of VM. Could not reserve enough space for object heap"
This is my eclipse.ini
-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.v20120913-144807
-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.8
-Xms1336m
-Xmx1336m
-Declipse.buildId=v22.3.0-887826
-XX:MaxPermSize=512M
I tried to change "256m" in "512m" but it still doesn't work. I tried to restart but nothing. I tried to change the -XX:MaxPermSize=512M value, but nothing.
Just add your JDK path in windows environment variable.
Open eclipse.ini and change the following variables.
For -Dosgi.requiredJavaVersion=1.8, try changing your required Java version to 1.6.
Memory-related defaults (as of Eclipse 3.4):
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
Recommended settings for Android development:
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
If everything else fails you can just delete or rename eclipse.ini and let the IDE handle everything. I strongly suggest looking for a current replacement for your eclipse.ini and reading up on how to configure the eclipse.ini for Android development.
Closed all the other memory intensive application in my windows7. And tried to
open eclipse. This worked for me, and I found it on similar question here Stackoverflow-eclipse failed to create JVM.
I am working on a fairly large project and have recently bumped into the good old friend of mine from the 90's, typing lag.
My setup is MacBook Pro 2.2 GHz i7 8GB with SSD drive and it hasn't had any serious performance issues so far.
I have increased the memory allocations to -Xmx1024m and -XX:MaxPermSize=512m. There is no heavy use of plugins involved. Also, this only happens on .java files in the default editor.
What could be the problem?
EDIT:
I found the problem. I noticed that the problem occurred only when editing large java files. In my case the class had 1800 rows.
It's weird though, since I am not facing the same problem with the same eclipse setup on Ubuntu. It seems like Eclipse on Mac just can't handle java files that big I was editing.
Any suggestions?
EDIT2:
I am using the Eclipse Indigo for Java EE with the latest updates (3.7.1.X)
Installed plugins:
m2eclipse
MercurialEclipse aka HGE (1.9.1 from the official eclipse update site)
Subclipse (installed, but not used in the workspace where the typing lag occurs)
ADT (installed, but not used in this project)
All plugins are installed via Eclipse marketplace and are updated to the latest release unless stated otherwise.
Try altering the settings in your eclipse.ini file. This contain the settings for the JVM and can help reduce memory issues like this.
Example eclipse.ini:
-data
../../workspace
-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
384m
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-vm
../../../../program files/Java/jdk1.6.0_17/jre/bin/client/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-Dcom.sun.management.jmxremote
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=C:/jv/eclipse/mydropins
Detailed in this question and this question.
Jivings was right about the root of the problem being in the eclipse.ini file.
I am not sure what I have actually changed in the eclipse.ini after messing around with the it, since the TimeMachine does not seem to be able to save a backup of the .ini file inside the Eclipse application package (Eclipse/Contents/MacOS/eclipse.ini).
I actually lowered the MaxPermSize and other memory values which made Eclipse run smoother. If anyone else is encountering the same problem, I suggest you try similar values and see if that works. If it doesn't, I also read that you can start eclipse once with the -clean argument, which cleans up some installation and usage history among other things. I did not do that, but it's worth a try.
The following is my current configuration, and it works pretty well:
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.100.v20110502
-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
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
I am trying to change and increase the default -Xmx768m to -Xmx1024 in STS.ini. However, on startup I get an error saying "Failed to create the JVM".
If I revert it back to 768 it works fine. Any idea as to what am I doing wrong and how can I improve the performance of STS?
Here is the configuration
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
com.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx768m
-XX:MaxPermSize=256m
You could try to attach the jvisualvm profiler tool (can be found in the bin folder of your jdk). If anything the tool will give you info about the jvm and its resource usage.
Be careful to use the tool that comes with the jdk you use for STS (most likely the one in JAVA_HOME but not necessarily).
Mind you that on a 32bit OS the JVM will never be able to get more than 1.6 GB of memory. If you have other software already in that same JVM as STS, jvisualvm will list them in the left side panel.