简体   繁体   English

java.lang.OutOfMemoryError:PermGen空间

[英]java.lang.OutOfMemoryError: PermGen space

i'm getting the following error "http-9000-5" java.lang.OutOfMemoryError: PermGen space 我收到以下错误“http-9000-5”java.lang.OutOfMemoryError:PermGen space

org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError: PermGen space. org.apache.catalina.core.ApplicationDispatcher为servlet jsp调用SEVERE:Servlet.service()抛出异常java.lang.OutOfMemoryError:PermGen空间。

My application using axis2.I increased the heap size 1024mb.But its not working.What would be the problem.Solution please 我的应用程序使用axis2.I增加了堆大小1024mb.But它不工作。这将是什么问题。解决方案请

PermGen and heap size are different from each other. PermGen和堆大小彼此不同。

You need to increase permgen space like this: 你需要像这样增加permgen空间:

-XX:PermSize=256m 
-XX:MaxPermSize=256m

add this flags. 添加此标志。

Also look at this: explaining-java-lang-outofmemoryerror-permgen-space and this: how-to-deal-with-java-lang-outofmemoryerror-permgen-space-error 另外看看这个: 解释-java-lang-outofmemoryerror-permgen-space和this: how-to-deal-with-java-lang-outofmemoryerror-permgen-space-error

Hope this helps. 希望这可以帮助。

you need to set something in your tomcat argument 你需要在你的tomcat参数中设置一些东西

JAVA_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"

Note:XX:MaxPermSize=256m 注:XX:MaxPermSize参数=256米

如果您使用Tomcat作为Eclipse的服务器,请转到服务器视图,然后双击Tomcat,然后“打开启动配置”,转到参数选项卡,并在设置-Dcatalina.base =“”之后将此设置为

-Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:PermSize=128m

除了提高PermGen大小外,还可以尝试启用permgen垃圾回收

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

Try increasing the ram allocation for your JVM. 尝试增加JVM的ram分配。 It should help. 它应该有所帮助。

Fix for eclipse: You can configure this in eclipse preference as follows 修复eclipse:你可以在eclipse偏好中配置如下

Windows -> Preferences ( on mac its: eclipse ->preferences) Java -> Installed JREs Select the JRE and click on Edit on the default VM arguments field type in --Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:PermSize=128m. Windows - > Preferences(在Mac上:eclipse - > preferences)Java - >已安装的JRE选择JRE并单击默认VM参数字段上的Edit --Xms256m -Xmx512m -XX:MaxPermSize = 512m -XX:PermSize = 128米。 (or your memory preference,for 1 gb of ram its 1024) Click on finish or OK. (或者你的记忆偏好,对于1 gb的ram是1024)点击完成或OK。

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

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