您的位置:首页 > 编程语言 > Java开发

Eclipse+Maven+Jetty 环境下java.lang.OutOfMemoryError: PermGen space及其解决方法

2015-01-07 14:08 806 查看
系统运行在MAVEN中的jetty插件下,系统运行期间后台日志提示OutOfMemoryError: PermGen space。

解决办法:

设置run as --->run configuragtions--->jre标签下的属性VM arguments:

-server -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled

-XX:+PrintGCDetails -Xloggc:%M2_HOME%/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%M2_HOME%/java_pid.hprof

其中参数说明如下:

-XX:+CMSPermGenSweepingEnabled : 允许permgenspace的垃圾回收

-XX:+CMSClassUnloadingEnabled : allows the garbage collector to remove even classes from the memory

-XX:PermSize=256M -XX:MaxPermSize=256M : raises the amount of memory allocated to the permgenspace
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: