简体   繁体   中英

jenkins deploy plugin. out of memory

I use Jenkins with deploy plugin, maven3 and tomcat7. Previously all worked fine, but new .war with new libraries cause OutOfMemoryError (java heap size) exception during deploying .

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. Or if I restart tomcat and .war will be auto deployed - all works fine.

I increased the java heap memory for tomcat in /etc/default/tomcat7 and issue was fixed, but in my opinion it's bad solution. Why OutOfMemory happens using jenkins?

Thanks

Jenkins gets an OutOfMemoryException when the Maven job you're running is out of memory. Every Maven buildstep in a Jenkins job will be run separately, so every step can have it's own settings. To fix this issue, you can assign more memory to a specific Maven build step.

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). When assigning more memory (for instance -Xmx1024m -Xms256m -XX:MaxPermSize=1024m) the specified buildstep will less likely run out of memory. If it still does, you should play with the numbers.

Does this answer your question?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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