PermGen Space error when deploying tomcat 7? [duplicate]

淺唱寂寞╮ 提交于 2019-11-28 18:48:09
Ilya

More helpful solution is to increase values in JAVA_OPTS variable.
Add next line to your Catalina.bat/Catalina.sh file in bin directory

For Windows (Catalina.bat)

set JAVA_OPTS="-Xms1024m -Xmx10246m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m"  

For Unix (Catalina.sh)

export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m"  

More solutions you can find in this article

Zelldon

Sometimes after re-deployments the Garbage Collector can't destroy some objects on Tomcat and run out of space. There are many reasons for these case:

  • If you use some CRUD-Objects - check if there are all closed after using.
  • If your app used other libs - sometimes the Objects from these libs cant also be destroyed, like MysqlConnector, Hibernate/C3p0 or other - try to put these libs on the tomcat/lib folder

Check the Tomcat with the "Java VisualVM" and check the permGen after re-deployment.
The default value for the permGen Space are often also very low you can increase them with the following javaVM parameter

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

You can follow these tutorial

http://www.mkyong.com/tomcat/tomcat-javalangoutofmemoryerror-permgen-space/

UPDATE

other solution maybe found here : what to do with tomcat PermGen space

add -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC to the javaVM options

Tweak the value of the permgen using -XX:PermSize={value} and -XX:MaxPermSize={value} via the JAVA_OPTS variable where 'value' is a string like 256m.

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