Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve java.lang.OutOfMemoryError: GC overhead limit exceeded error in android studio

I am using android studio 1.0 RC for 64 bit linux.

When I run my application I am getting

"java.lang.OutOfMemoryError: GC overhead limit exceeded" 

When I searched on how to solve this error I got solutions like add:

  • -XX:-UseGCOverheadLimit to studio.vmoptions or studio64.vmoptions
  • -Xmx2000m to studio.vmoptions or studio64.vmoptions etc.

These did not work for me.

Please help. Thanks in advance

like image 544
user3008777 Avatar asked Nov 27 '14 06:11

user3008777


People also ask

What is GC overhead limit?

GC Overhead Limit Exceeded ErrorIt's thrown by the JVM when it encounters a problem related to utilizing resources. More specifically, the error occurs when the JVM spent too much time performing Garbage Collection and was only able to reclaim very little heap space.

How do you resolve GC overhead limit exceeded in Talend?

Open the Job in Studio, and navigate to the Advanced > Run tab below the designer view. Click the plus [+] sign next to the JVM parameters window, and a dialog will open where you can add the -XX:-UseGCOverheadLimit flag.


1 Answers

I solved this issue by adding

dexOptions {            incremental true            javaMaxHeapSize "4g"  }  

to the android closure in build.gradle file. Found this answer in

OutOfMemoryError: GC overhead limit exceeded

like image 162
user3008777 Avatar answered Sep 17 '22 17:09

user3008777