1. 程式人生 > >mvn jetty:run出現OutOfMemoryError: PermGen space的處理

mvn jetty:run出現OutOfMemoryError: PermGen space的處理

處理方法: 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 其中引數說明如下: -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 也不行。