java.lang.OutOfMemoryError: PermGen space

╄→尐↘猪︶ㄣ 提交于 2019-11-28 23:35:43

If you're using Tomcat as a Server of Eclipse, go to Server view, then double click on Tomcat, then "Open Launch Configuration", go to Arguments tab, and after setting -Dcatalina.base="" put this

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

PermGen and heap size are different from each other.

You need to increase permgen space like this:

-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

Hope this helps.

you need to set something in your tomcat argument

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

In addition to raising the PermGen size, try enabling permgen garbage collection with

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

Try increasing the ram allocation for your JVM. It should help.

Fix for eclipse: You can configure this in eclipse preference as follows

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. (or your memory preference,for 1 gb of ram its 1024) Click on finish or OK.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!