PermGen out of space before Max is reached
I run a Java web application on a Tomcat with JPA/Hibernate and frequently get 'PermGen out of space'.
Can anybody explain this graphical memory profile?
Heap memory: I'm running to the maximum, but there is still some room (2.147.483.648 Max, but 1.667.155.688 used)
Non-Heap memory: The size is dropping (94.568.448), while the max allows 5 times more. This is a snapshot just before the 'PermGen out of space' (when Size = Used)
I don't understand this profile. There is still a lot of physical memory left.
This is one of the Tomcat classical questions. One of the best answers is here:
https://stackoverflow.com/a/10392385/1314276
This problem is often related to some memory leak. PermGen or permanent generation is a part of the heap where for example String
objects and Class
definitions get allocated. You can easily run out of PermGen when you still have space left on the heap and/or physical memory.
You can increase the perm gen size but in most cases it will just prolong the problem because you'll just buy some time with it.
We need to see the code which causes this error because we can't help you based on some graphs. These links might help you if you don't understand how memory management works in java: Jvm performance enhancements, Java garbage collector
Perm gen space does not intersect with Heap. You should use -XX:PermSize and -XX:MaxPermSize parameters.
链接地址: http://www.djcxy.com/p/54996.html上一篇: java.lang.OutOfMemoryError:Jetty发生PermGen空间错误
下一篇: 在达到Max之前,PermGen空间不足