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)

enter image description here

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)

enter image description here

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top