增加Tomcat内存设置 [英] Increase Tomcat memory settings

查看:121
本文介绍了增加Tomcat内存设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
处理"java.lang.OutOfMemoryError:PermGen space"错误

Possible Duplicate:
Dealing with “java.lang.OutOfMemoryError: PermGen space” error

我的开发机中有8GB RAM,并试图运行Apache Tomcat(7.0.29)来同时托管人工工厂(2.6.3)和 Jenkins(1.479)同时时间.我试图找到Jenkins的内存需求,但看起来他们的Wiki崩溃了.

I have 8GB RAM in my development machine, and am trying to run Apache Tomcat (7.0.29) to host both Artifactory (2.6.3) and Jenkins (1.479) at the same time. I tried to find the memory requirements for Jenkins but it looks like their wiki is down.

${TOMCAT_HOME}/bin/catalina.sh中,我添加了以下命令:

In ${TOMCAT_HOME}/bin/catalina.sh, I have added the following command:

CATALINA_OPTS="$CATALINA_OPTS -server -Xms1024m -Xmx3052m"

这应该将Tomcat的JVM的大小保持在(基本上)1到3 GB之间,给我留出足够的空间来容纳其他内容,为Tomcat留出足够的内存来存放Artifactory/Jenkins,甚至在我的情况下也可以想要的.

This should keep Tomcat's JVM between (essentially) 1 and 3 GB in size, leaving me plenty of room for other stuff, and giving Tomcat enough memory for Artifactory/Jenkins, and even others if I wanted.

(为此,我尝试使用JAVA_OPTS进行相同的操作只是为了获得相同的准确结果).我保存该更改并运行startup.sh. Tomcat开始启动,然后死于OOMEs,抱怨Tomcat已经用完了PermGen空间:

(For what it's worth I've tried the same with JAVA_OPTS only to get the same exact result). I save that change and run startup.sh. Tomcat begins to start up, and then dies with OOMEs complaining that Tomcat has ran out of PermGen space:

Exception in thread "SocketListener(<hex-stuff>.local.)"
java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
Exception in thread "hudson initialization thread" java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space

我要去哪里呢?我已经阅读了多篇有关如何执行此操作的文章,并且(相信!)我正在精确地关注它们.关于如何进一步调试的任何想法或想法?预先感谢!

Where am I going awrye here? I have read multiple articles on how to do this and (believe!) I'm following them precisely. Any thoughts, or ideas as to how I could debug this further? Thanks in advance!

推荐答案

尝试设置此

CATALINA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 
-server -Xms1536m -Xmx1536m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m 
-XX:MaxPermSize=256m -XX:+DisableExplicitGC"

中的

(如有必要,请创建).

in {$tomcat-folder}\bin\setenv.sh (create it if necessary).

请参阅 http://www.mkyong.com/tomcat/tomcat-javalangoutofmemoryerror-permgen-空格/了解更多详细信息.

See http://www.mkyong.com/tomcat/tomcat-javalangoutofmemoryerror-permgen-space/ for more details.

这篇关于增加Tomcat内存设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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