Search code examples
javaandroidout-of-memorydalvik

Unable to execute dex: GC overhead limit exceeded in Eclipse


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.


Solution

  • 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 enter image description here