我正在使用 Go CD 和gocd-sbt-plugin构建一个带有 SBT 的 Java+Scala 多模块项目。java.lang.OutOfMemoryError: Java heap space
但是,当我尝试编译和打包模块时,内存不足 ( )。
在 Jenkins CI 中,SBT 插件为我提供了在构建操作中添加 JVM 标志和 sbt 标志的选项。目前我们正在使用这些 JVM 标志:
-Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xss2M
我没有在 Go 文档中找到答案,也没有尝试将上述参数放在“附加选项”文本框中。
当我尝试后者时,我得到了这个堆栈跟踪:
15:02:23.288 [info] Compiling 54 Scala sources and 3495 Java sources to /gocd/var/lib/go-agent/pipelines/de/component/build/scala-2.11/classes...
15:04:31.744 java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
15:04:31.744 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
15:04:31.744 at java.util.concurrent.FutureTask.get(FutureTask.java:192)
...
15:04:31.744 at xsbt.boot.Boot.main(Boot.scala)
15:04:31.744 Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
15:04:31.744 at java.util.jar.Attributes.read(Attributes.java:394)
15:04:31.744 at java.util.jar.Manifest.read(Manifest.java:199)
...
15:04:31.744 at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
15:04:31.744 [error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
15:04:31.744 [error] Use 'last' for the full log.
15:04:31.760 [error] Expected key
15:04:31.760 [error] Expected '*'
15:04:31.760 [error] XX:+CMSClassUnloadingEnabled
15:04:31.760 [error] ^
15:04:31.858 Error: Interaction with plugin with id 'sbt.task.plugin' implementing 'task' extension failed while requesting for 'execute'. Reason: [Unsuccessful response from plugin. Plugin returned with code '500' and the following response: '{"exception":null,"success":false,"message":"Build failure"}']
15:04:31.865 [go] Current job status: failed.
我相信任务仍然失败,因为它没有使用这些导致 Jenkins 构建成功的标志。有人可以指出我可以在哪里将上述 JVM 标志传递到我的 Go SBT 任务中吗?