简体   繁体   English

jenkins部署插件。 记不清

[英]jenkins deploy plugin. out of memory

I use Jenkins with deploy plugin, maven3 and tomcat7. 我将Jenkins与deploy插件,maven3和tomcat7结合使用。 Previously all worked fine, but new .war with new libraries cause OutOfMemoryError (java heap size) exception during deploying . 以前,一切正常,但是带有新库的新.war部署过程中导致OutOfMemoryError (java堆大小)异常。

Note: building was successfully 注意:构建成功

This issue caused only if I use jenkins. 仅当我使用詹金斯时才引起此问题。 If I try to deploy .war file (that was placed in /tomcat/webapps by jenkins) manually directly from tomcat manager - all works fine. 如果我尝试直接从tomcat管理器手动部署.war文件(jenkins将该文件放置在/tomcat/webapps ),则一切正常。 Or if I restart tomcat and .war will be auto deployed - all works fine. 或者,如果我重新启动tomcat并且.war将自动部署-一切正常。

I increased the java heap memory for tomcat in /etc/default/tomcat7 and issue was fixed, but in my opinion it's bad solution. 我在/ etc / default / tomcat7中为tomcat增加了Java堆内存,并且此问题已解决,但我认为这是一个不好的解决方案。 Why OutOfMemory happens using jenkins? 为什么使用詹金斯会发生OutOfMemory?

Thanks 谢谢

Jenkins gets an OutOfMemoryException when the Maven job you're running is out of memory. 当您正在运行的Maven作业内存不足时,Jenkins将获得OutOfMemoryException。 Every Maven buildstep in a Jenkins job will be run separately, so every step can have it's own settings. Jenkins作业中的每个Maven构建步骤将单独运行,因此每个步骤都可以具有自己的设置。 To fix this issue, you can assign more memory to a specific Maven build step. 要解决此问题,您可以将更多内存分配给特定的Maven构建步骤。

When a build contains a "Invoke a top-level Maven targets" buildstep there is the option to ajust the JVM options (this can be found after clicking the advanced button). 当构建包含“调用顶级Maven目标”构建步骤时,可以选择调整JVM选项(可在单击高级按钮后找到)。 When assigning more memory (for instance -Xmx1024m -Xms256m -XX:MaxPermSize=1024m) the specified buildstep will less likely run out of memory. 当分配更多内存时(例如-Xmx1024m -Xms256m -XX:MaxPermSize = 1024m),指定的构建步骤将不太可能耗尽内存。 If it still does, you should play with the numbers. 如果仍然有效,则应使用数字。

Does this answer your question? 这回答了你的问题了吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM