1

我正在将早期在 Jboss 4.2.3 上的 Web 应用程序移植到 Jboss 6 上。总共大约有 12 个 Web 应用程序,其中目前仅部署了 4 个。

这些 Web 应用程序基于 Axis2 1.5.5、spring 2.5、hibernate 3.2.5、OpenJPA 1.0、saxon 9.1。

类加载器隔离设置如下

<class-loading java2ClassLoadingCompliance="false">
        <loader-repository>
            webapp:loader=webapp.war
            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
        </loader-repository>
</class-loading>

我看到 PermGen 已经达到 440MB 并且在 Jboss 6 上增长,我已经设置-XX:MaxPermSize=512m

任何人都可以在这里为我提供确定问题的输入。

环境:JDK 1.6.0_26,Ubuntu 11.10

4

2 回答 2

0

JBoss 6 对 perm gen 内存方面要求更高的原因,我不知道。但是当您禁用注释扫描(如果不使用它)时,启动时间可能会有所改善。它对我们的申请很有帮助。

于 2013-04-04T11:15:21.200 回答
0

我上周遇到了同样的问题。JBoss-6 微容器尝试通过在启动时从类路径中的所有 JAR 加载类来扫描 Jboss 特定的注释。这会导致 PermGen 膨胀,因为它开始加载所有不需要的类。

为了减少扫描量,微容器通过 jboss-scanning.xml 提供了另一个描述符挂钩。将此“jboss-scanning.xml”添加到 WAR 内的 WEB-INF,并将“jboss-scanning.xml”添加到 EAR 内的 META-INF。

<scanning xmlns="urn:jboss:scanning:1.0">

    <!-- Purpose: Disable scanning for annotations in contained deployment. -->

</scanning>
于 2013-06-29T18:45:37.163 回答