jBoss 4.0.2 deploying same WAR multiple times causes jBoss to crash because of PermGem/Out-of-Memory Errors

前端 未结 3 1192
悲&欢浪女
悲&欢浪女 2021-01-13 20:26

I develop web applications and I use jBoss 4.0.2 and when I have redeployed my WAR several times with eclipse, jBoss will crash because it runs out of memory. And when I hav

3条回答
  •  别那么骄傲
    2021-01-13 21:00

    Basically, no. Because of the way the JBoss classloaders work, each deployment will use up a chunk of PermGen that will not be released even if the application is undeployed.

    You can mitigate the symptoms by ramping up the PermGen memory pool size to several hundred megs (or even gigs), which makes the problem easier to live with. I've also found that reducing the usage of static fields in your code (especially static fields that refer to large objects) reduces the impact on PermGen.

    Ideally, I would not use hot deployment in production, but rather shut the server down, replace the WAR/EAR, then restart it.

提交回复
热议问题