[构建失败]gradle
lvxiaoqian555 opened this issue · 2 comments
obs上构建超时
本地构建报错
:buildSrc:build
[ 8024s] Unexpected exception thrown.
[ 8036s] java.lang.OutOfMemoryError: Java heap space
[ 8039s] at org.gradle.process.internal.worker.WorkerJvmMemoryInfoSerializer$JvmMemoryStatusSerializer.read(WorkerJvmMemoryInfoSerializer.java:42)
[ 8042s] at org.gradle.process.internal.worker.WorkerJvmMemoryInfoSerializer$JvmMemoryStatusSerializer.read(WorkerJvmMemoryInfoSerializer.java:37)
[ 8045s] at org.gradle.internal.remote.internal.hub.DefaultMethodArgsSerializer$ArraySerializer.read(DefaultMethodArgsSerializer.java:71)
[ 8045s] at org.gradle.internal.remote.internal.hub.DefaultMethodArgsSerializer$ArraySerializer.read(DefaultMethodArgsSerializer.java:60)
[ 8048s] at org.gradle.internal.remote.internal.hub.MethodInvocationSerializer$MethodInvocationReader.readArguments(MethodInvocationSerializer.java:124)
[ 8051s] at org.gradle.internal.remote.internal.hub.MethodInvocationSerializer$MethodInvocationReader.read(MethodInvocationSerializer.java:119)
[ 8051s] at org.gradle.internal.remote.internal.hub.MethodInvocationSerializer$MethodInvocationReader.read(MethodInvocationSerializer.java:99)
[ 8051s] at org.gradle.internal.serialize.kryo.TypeSafeSerializer$1.read(TypeSafeSerializer.java:34)
[ 8054s] at org.gradle.internal.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:66)
[ 8054s] at org.gradle.internal.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:52)
[ 8057s] at org.gradle.internal.remote.internal.inet.SocketConnection.receive(SocketConnection.java:79)
[ 8057s] at org.gradle.internal.remote.internal.hub.MessageHub$ConnectionReceive.run(MessageHub.java:263)
[ 8057s] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
[ 8057s] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
[ 8060s] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[ 8060s] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[ 8060s] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
[ 8060s] at java.lang.Thread.run(Thread.java:748)
[ 8333s]
[ 8333s] FAILURE: Build failed with an exception.
修改 gradle.properties 文件,仍然会报OutOfMemoryError
-org.gradle.jvmargs=-Xmx2g -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
再次修改gradle.properties 文件,还是报OutOfMemoryError
-org.gradle.jvmargs=-Xmx2g -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options="-Xmx1g"
哪位老师遇过类似的问题?是我改的不够大还是改的方向就不对?
修改gradle.properties,为以下还是会报OutOfMemoryError
org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options="-Xmx1g"
spec中增加export MAVEN_OPTS=-Xmx2048m还是报OutOfMemoryError
@lvxiaoqian555 现在新obs上用原有的gradle.properties可以构建成功了