Java Class (PermGen) Memory Leak (Web Applications) - Generic Solution?

前端 未结 4 1767
野趣味
野趣味 2021-01-01 21:44

I have a perm gen memory leak, that I know. Profiling using jvisualvm shows that when doing hot deployment (e.g. stop and start an application without killing the JVM, in to

相关标签:
4条回答
  • 2021-01-01 22:25

    There is an unsatisfiying but easy solution: Don't hotdeploy in production environments. You could setup a cluster of two servlet containers and them update one at a time with a restart.

    0 讨论(0)
  • 2021-01-01 22:28

    Few pointers here as well, http://minmaxmim.blogspot.com/2010/01/javalangoutofmemoryerror-java-heap.html

    also check the javalangoutofmemoryerror-permgen-space article.

    0 讨论(0)
  • 2021-01-01 22:30

    The realities of frequent redeployments... Best you can do is increase the size of perm gen using -XX:MaxPermSize=256m. This may buy you some redeployments more per jvm restart. Or read on at http://my.opera.com/karmazilla/blog/2007/03/15/permgen-strikes-back

    Beware that if the classloaders can't be gc-ed at all, fiddling with the jvm won't help at all. You'd better forget about frequent deployments, especially in production, for dev it's handy, nevertheless.

    0 讨论(0)
  • 2021-01-01 22:36

    I used the method from this site and it helped. http://www.mkyong.com/tomcat/tomcat-javalangoutofmemoryerror-permgen-space/

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