What can be done with 'PermGen out of space' exception in Tomcat-Spring-Hibernate web application?

前端 未结 8 876
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 05:12

We have an web application that uses Spring-Hibernate to persist registered users data in Oracle database. The application works fine in development environment, but when we

相关标签:
8条回答
  • 2020-12-05 05:52

    The -XX:MaxPermSize does work, you've just got to get the right value. The default, I believe, is 32mb for t the client-mode VM, and 64mb for the server mode VM. I suggest setting it to 256mb, if you have the memory:

    java -XX:MaxPermSize=256m
    

    The problem occurs because Spring and Hibernate can make heavy use of runtime-generated classes, sometimes a lot of them. These generated classes all go into the PermGen memory pool, so if you use those frameworks, you often need to boost your PermGen to large amounts.

    0 讨论(0)
  • 2020-12-05 05:52

    All responses here relates to PermGen problem that happens because of several restarts of web-app, but in this case the problem already happens on first deployment after tomcat restart, so it can't be the problem of ClassLoader's references or commons-logging.

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