Exceeded GC limit exceeded attempt to create LibGDX project
I am trying to run a LibGDX project with an iOS config, but I keep giving 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 tried modifying the gradlew file with the following parameters, 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? Thank!
source to share
I had the same problem ... but I found a solution! Open the gradle.properties file and it should look something like this:
org.gradle.daemon=true
org.gradle.jvmargs=-Xms128m -Xmx512m
org.gradle.configureondemand=true
You must edit the second line! Change "-Xms128m" to "-Xms1024m", "-Xmx512m" to "-Xmx4096m" and "gradle.properties" in the final should look like this:
org.gradle.daemon=true
org.gradle.jvmargs=-Xms1024m -Xmx4096m
org.gradle.configureondemand=true
What is it!
source to share
You can turn off this error by adding the following flag: -XX: -UseGCOverheadLimit, But this is a bad approach.
This exception is thrown when the FULL GC ran frequently at the last minute and did not free memory (or released too low memory).
You can try to add extra memory, for example try adding -Xmx3048m (or more). If the exception still occurs, then there is definitely a memory leak problem.
source to share