Skip to content Skip to sidebar Skip to footer

Android Studio: GC Overhead Limit Exceeded

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > java.lang.OutOfMemoryError: GC overhead limit exceeded Tried: dexOptions { javaMaxHeapSize '4g' }

Solution 1:

This is a problem of not enough java heap for gradle, not IDE

I increased Java Heap in gradle.properties

org.gradle.jvmargs=-Xms1024m -Xmx4096m

Solution 2:

Increase the IDE memory (file studio.vmoptions)

http://tools.android.com/tech-docs/configuration

My settings:

-Xms256m
-Xmx3080m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=225m
-XX:+UseCompressedOops

Solution 3:

If anyone still facing the issue and there is no impact on increasing the IDE memory and gradle.properties than invalidate cache/restart is the last option for you. In my case it is working after invalidate cache/restart


Solution 4:

It seems to be connected with this bug https://code.google.com/p/android/issues/detail?id=199619


Solution 5:

If somebody faces this issue in the future, and can't increase the IDE memory, there is another option, you need to go to your android folder and there you will find a dump file that will be likely more than 400mb, delete that file and try again. Cheers


Post a Comment for "Android Studio: GC Overhead Limit Exceeded"