1
我正在使用Go CD和gocd-sbt-plugin用SBT構建Java + Scala多模塊項目。但是,當我嘗試編譯和打包模塊時,我的內存不足(java.lang.OutOfMemoryError: Java heap space
)。如何在Go SBT任務中指定JVM標誌?
在Jenkins CI中,SBT插件爲我提供了在構建操作中添加JVM標誌和sbt標誌的選項。目前,我們正在使用這些JVM標誌:轉到文檔中
-Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xss2M
我還沒有找到答案,或者試圖把上述論點在「其他選項」文本框。
當我試圖後者,我得到這個堆棧跟蹤:
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.
我相信,因爲它不使用這些標誌會產生一個成功的詹金斯建設任務仍然失敗。有人能指出我可以將上述JVM標誌傳入我的Go SBT任務嗎?