处理方法:
VM参数中添加如下配置:
-server -Xms256m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDetails -Xloggc:%M2_HOME%/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%M2_HOME%/java_pid<pid>.hprof
![](http://dl.iteye.com/upload/attachment/0083/1150/8f9afa90-53d2-3566-ab3d-656bea98ec7d.png)
![](http://dl.iteye.com/upload/attachment/0083/1152/46c11021-fcf2-3eab-b035-a2494ab1bc31.png)
其中参数说明如下:
-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
试过在系统环境变量中添加 MAVEN_OPTS="-Xms40m -Xmx512m -XX:PermSize=512m" 不行,在eclipse.ini文件中添加 -Xms40m -Xmx512m -XX:PermSize=512m 也不行。