java.lang.OutOfMemoryError: PermGen space in tomcat with eclipse

前端 未结 3 1818
既然无缘
既然无缘 2020-12-13 06:01

i get this exception frequently when running my app on tomcat using eclipse:

java.lang.OutOfMemoryError: PermGen space
    at java.lang.ClassLoader.defineCla         


        
相关标签:
3条回答
  • 2020-12-13 06:28

    You can configure these arguments for eclipse:

    "To solve this I stopped the server in Eclipse. Double clicked on the server in the Servers tab to open the Overview page for the server. Clicked on Open Launch Configuration and then on the Arguments tab.

    I added the following VM arguments :

    -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
    

    ref to http://malcolmmallia.com/malcblog/?p=60

    0 讨论(0)
  • 2020-12-13 06:40

    I got this problem today as well. It happened completely out of the blue. Yesterday I've updated JDK/JRE from 1.6.0_13 to 1.6.0_21 to fix a Glassfish 3.0.1 specific issue and Eclipse suddenly broke with those OutOfMemoryError: PermGen space errors. After (incorrectly) ranting on the Glassfish plugin and concluding that the issue wasn't fixed after cleaning the workspace metadata, it turns out that this is caused by the change of JVM vendor string from "Sun" to "Oracle" since 1.6.0_20. Eclipse didn't recognize the new JVM vendor and thus didn't apply the VM arguments as specified in eclipse.ini.

    This was reported as Eclipse issue 319514 and the Eclipse boys quickly released a patch. Until they get it fixed more permanently, the workaround is indeed to add the following lines to the eclipse.ini:

    -XX:MaxPermSize=256m
    

    So, if you recently did a JVM update, it might be worth to take a look to it.

    0 讨论(0)
  • 2020-12-13 06:42

    try to raise perm space, add following parameters to vm start-up

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

    also add -XX:MaxPermSize=256m to Tomcat in Eclipse: Server > Open Launch Configuration > Arguments

    Update (in 2014): take a look here at this question and answer about the new Java 8 Metaspace.

    and take a look here:

    How to deal with “java.lang.OutOfMemoryError: PermGen space” error

    0 讨论(0)
提交回复
热议问题