jBoss 4.0.2多次部署相同的WAR会导致jBoss崩溃,因为PermGem /内存不足错误 [英] jBoss 4.0.2 deploying same WAR multiple times causes jBoss to crash because of PermGem/Out-of-Memory Errors

查看:80
本文介绍了jBoss 4.0.2多次部署相同的WAR会导致jBoss崩溃,因为PermGem /内存不足错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发Web应用程序并使用jBoss 4.0.2,当我使用eclipse多次重新部署WAR时,jBoss会崩溃,因为内存不足。当我必须将新版本安装到生产环境时,它将消耗生产服务器内存,因此这意味着我必须停止jBoss以防止从客户服务器重新部署内存。这个问题有什么解决方法吗?

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 have to install new version to production enviroment, it will consume production servers memory, so that means I have to stop jBoss to prevent redeploying eat memory from customers server. Is there any work around for this problem?

推荐答案

基本上没有。由于JBoss类加载器的工作方式,每个部署都会耗尽一大块PermGen,即使取消部署应用程序也不会发布。

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.

你可以减轻这些症状通过将PermGen内存池大小增加到几百兆(甚至是演出),这使得问题更容易使用。我还发现减少代码中静态字段的使用(特别是引用大对象的静态字段)可以减少对PermGen的影响。

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.

理想情况下,我会不要在生产中使用热部署,而是关闭服务器,替换WAR / EAR,然后重新启动它。

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

这篇关于jBoss 4.0.2多次部署相同的WAR会导致jBoss崩溃,因为PermGem /内存不足错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆