jBoss 7中的jstl forEach标签,内存泄漏? [英] jstl forEach tag in jBoss 7, memory leak?

查看:104
本文介绍了jBoss 7中的jstl forEach标签,内存泄漏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

YourKit分析器用于分析快照.

The YourKit profiler is used to analyze snapshot.

已执行的步骤(针对唯一用户):

Steps that have been performed (for the only user):

  1. 世代数增加了.
  2. 应用程序页面上的某些操作已完成.它们中的大多数会获得实体,并通过jstl forEach标签显示它们.
  3. 已执行注销(session.invalidate())
  4. 会话超时设置为5分钟.因此,我已经等待了6-8分钟,以确保会话中的所有内容均无效.
  5. 通过YourKit分析器创建了快照.

我发现的东西:

SomeEntity
#3: Captured snapshot JBoss-2014-10-07-1.snapshot 11m 37s - 21m 43s 183 4392 7896

<All the objects> 183 7896
    java.lang.Object[] 182 7832
        java.util.ArrayList 182 7832
            somePath.someImpl 167 7208
                java.lang.Object[] 164 7016
                    java.util.ArrayList 164 7016
                        org.apache.taglibs.standard.tag.rt.core.ForEachTag 164 7016
                somePath.someAnotherImpl 3 192
                    java.lang.Object[] 3 192
                        java.util.ArrayList 3 192
                            org.apache.taglibs.standard.tag.rt.core.ForEachTag 3 192

我们在这里可以看到的内容(如果我错了,请修复我)ForEachTag标记包含164 + 3个SomeEntity实例.我研究了jstl问题,发现问题已重现.例如,此处,和

What we can see here (please fix me, if I'm wrong) the ForEachTag tag holds 164+3 instances of SomeEntity. I've investigated jstl issues and found that the problem had been reproduced. For example here, and here.

但是首先,根据jsp规范,据说在doEndTag中不要将可为null的对象确定是可以的(如果我错了,请修复我).其次,在最新的1.2 jstl版本中已经解决了一些问题.在jBoss 7中使用的是1.2版本,因此,问题似乎仍然存在.

But at first it's said that don't nullable objects is in the doEndTag is ok, according to jsp spec (please fix me if I'm wrong). And second some problems have been resolved in the last 1.2 jstl version. In jBoss 7 the 1.2 version is used, so, it seems the problem still exists.

一种解决方案-在doEndTag()中将可为空的对象视为不当做法. 在此处查看原因

One of solution - to nullable objects in the doEndTag() considered as a bad practice. See here the reason

接下来,我重复了前面由4个不同用户描述的操作.我发现org.apache.taglibs.standard.tag.rt.core.ForEachTag持有的对象数量现在为539 + 12.

Next, I've repeated the actions that are described previously by 4 different users. I could find that the number of object that are hold by org.apache.taglibs.standard.tag.rt.core.ForEachTag is now 539+12.

对我来说-这是内存泄漏.如果我错了,请修复我.如果没有,在这种情况下我们该怎么办?要在doEndTag方法中为可空对象?

As for me, - it's a memory leak. If I'm wrong, please fix me. If not what can we do in this case? To nullable objects in the doEndTag method?

推荐答案

我没有适合您的答案,但我们发现Jboss 6和foreach标记非常相似.我们会继续调查(当我找到您的帖子时),如果有发现,我们会通知您.

I don't have an answer for you, but we're seeing something very similar with Jboss 6 and the foreach tag. We're continuing to investigate (when I found your post) and will let you know if we find anything.

-编辑--

我们添加了此修复程序,它解决了另一个内存泄漏问题,并且似乎也解决了foreach问题.

We added this fix, which resolved another memory leak issue, and seems to have resolved the foreach one as well.

对于Jboss,我们更新了:

For Jboss, we updated:

<subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" instance-id="${jvmRoute}" native="false">

            <configuration>

                <jsp-configuration trim-spaces="true" tag-pooling="false"/>

            </configuration>

我相信这是在standalone.xml文件中.

I believe this was in the standalone.xml file.

这篇关于jBoss 7中的jstl forEach标签,内存泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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