I am getting outOfMemoryError while building my project using gradle. I have tried many solution present in stackoverflow but nothing helped. Please find below the stacktrace
java.lang.OutOfMemoryError: Java heap space
at com.sun.tools.javac.util.ByteBuffer.<init>(ByteBuffer.java:45)
at com.sun.tools.javac.jvm.ClassWriter.<init>(ClassWriter.java:101)
at com.sun.tools.javac.jvm.ClassWriter.instance(ClassWriter.java:145)
at com.sun.tools.javac.main.JavaCompiler.<init>(JavaCompiler.java:295)
at com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:72)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.contextForNextRound(JavacProc
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingE
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:45)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
I have tried solutions like putting below lines in gradlew file.
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\" \"-Xmx1024m\" \"-Xms256m\" \"-XX:MaxPermSize=1024m\""
Kindly help me to resolve this. Thanks in advance.
-Xms1024m, Does your gradle can compile? Whether will it throw memory not enougth tip?