Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GC overhead limit exceeded trying to build LibGDX project

I'm trying to run a LibGDX project with the iOS configuration but I keep running into the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ios:launchIPhoneSimulator'.
> java.lang.OutOfMemoryError: GC overhead limit exceeded

I've tried modifying the gradlew file with the following params, but I still get the same error:

DEFAULT_JVM_OPTS="-Xmx2048m -XX:+UseConcMarkSweepGC"

Any ideas what else I can do to work around this issue? Thanks!

like image 228
Henrique Avatar asked Dec 10 '25 07:12

Henrique


2 Answers

Tried several different things (gradlew clean, removing the dependencies and downloading them again, increasing heap size all the way to 2g, etc), but eventually what fixed it was rebooting the machine.

Yeah, a reboot fixed it. Weird.

like image 64
Henrique Avatar answered Dec 11 '25 21:12

Henrique


I had the same problem... but I was found the solution! Open your "gradle.properties" file and it must be something like this:

org.gradle.daemon=true
org.gradle.jvmargs=-Xms128m -Xmx512m
org.gradle.configureondemand=true

You must to edit the second string! Change "-Xms128m" to "-Xms1024m", "-Xmx512m" to "-Xmx4096m" and "gradle.properties" in final must look like:

org.gradle.daemon=true
org.gradle.jvmargs=-Xms1024m -Xmx4096m
org.gradle.configureondemand=true

That's it!

like image 22
zharski Avatar answered Dec 11 '25 20:12

zharski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!