首页 > 解决方案 > 在 Spot 实例上增加节点大小时如何修复堆空间?

问题描述

我们一直使用 EC2 Windows 现货实例作为 Jenkins 从属服务器,但是,当将大小从 M5d2XLarge 增加到 M5d4XLarge 时(试图克服某些构建中的内存问题),这些实例无法创建。

我试图将 Java Opts Xms 和 Xmx 设置为 init 脚本的一部分,但是,错误没有改变。我读过 WinRM 可能是问题所在,但我很难将其与节点大小的增加联系起来。

这是预期的日志结果(来自 M5d2XLarge)

WinRM service responded. Waiting for WinRM service to stabilize on EC2 (Dev-US-East-1) - Windows Server 2019 Docker (i-xxxxxxxxxx)
WinRM should now be ok on EC2 (Dev-US-East-1) - Windows Server 2019 Docker (i-xxxxxxxxxx)
Connected with WinRM.
Creating tmp directory if it does not exist
Executing init script

C:\Users\Administrator>if not exist C:\Jenkins mkdir C:\Jenkins 
init script ran successfully
remoting.jar sent remotely. Bootstrapping it
Launching via WinRM:java  -jar C:\Windows\Temp\remoting.jar -workDir C:\Jenkins
Both error and output logs will be printed to C:\Jenkins\remoting

但是,在“通过 WinRM 启动”之后,由于垃圾收集器问题(来自 M5d4XLarge)而失败:

init script ran successfully remoting.jar sent remotely. Bootstrapping it 
Launching via WinRM:java -jar C:\Windows\Temp\remoting.jar -workDir C:\Jenkins 
Error occurred during initialization of VM
Unable to allocate 512384KB bitmaps for parallel garbage collection for the requested 16396288KB heap.
Ouch:
java.io.EOFException: unexpected stream termination

标签: javajenkinsamazon-ec2jenkins-plugins

解决方案


尝试更新运行remoting.jar. 将运行 jar 的这一行修改为

java -Xmx1024m -jar C:\Windows\Temp\remoting.jar -workDir C:\Jenkins 

推荐阅读