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

来源:互联网 发布:php 文件上传 测试 编辑:程序博客网 时间:2024/06/08 13:45

系统运行在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

0 0
原创粉丝点击