詹金斯构建抛出内存不足错误 [英] Jenkins build throwing an out of memory error

查看:22
本文介绍了詹金斯构建抛出内存不足错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们让 Jenkins 在 ec2 实例上运行.在进行构建时,我们看到以下错误:

We have Jenkins running on an ec2 instance. When doing a build, we see the following error:

17:29:39.149 [INFO] [org.gradle.api.Project] OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000007ac000000, 234881024, 0) failed; error='Cannot allocate memory' (errno=12)
17:29:39.150 [INFO] [org.gradle.api.Project] #

17:29:39.150 [INFO] [org.gradle.api.Project] # There is insufficient memory for the Java Runtime Environment to continue.

17:29:39.150 [INFO] [org.gradle.api.Project] # Native memory allocation (malloc) failed to allocate 234881024 bytes for committing reserved memory.

我研究了这个主题并尝试了各种设置,例如增加堆内存、ram 和 PermGenSize.这是我当前在 Jenkins 上的内存设置:

I researched on this topic and tried various settings such as increasing the heap memory, ram and PermGenSize. Here is my current memory setting on Jenkins:

-Xms256m -Xmx2048m -XX:MaxPermSize=512m

还有其他我遗漏的东西会导致 OOM 吗?

Are there any other things that I'm missing that's causing an OOM?

推荐答案

我也遇到过同样的问题.(我有 ec2、t2.micro、Ubuntu 14、Jenkins、Tomcat、Maven).默认情况下,您没有交换空间.要确认这一点:

I've sold the same problem. (I have ec2, t2.micro, Ubuntu 14, Jenkins, Tomcat, Maven). By default you don't have swap space. To confirm this:

free -m

添加一些.开始尝试使用 1 GB.

Just add some. Try with 1 GB for begin.

sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

再次检查:

free -m

有关更多详细信息,请查看 这里

For more details look here

这篇关于詹金斯构建抛出内存不足错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆