BodyContentImpl jsp标签内存泄漏问题

发布于 2024-10-08 02:08:48 字数 223 浏览 0 评论 0原文

我使用的是 Tomcat 版本 5.0.28,我正在分析堆转储。它显示内存泄漏是由于 BodyContentImpl 对象造成的,这似乎(不确定)它缓存了标签之间的 jsp 内容。 我还发现该版本存在问题,它不会重置内部用于保存数据的缓冲区。在tomcat的更高版本中,有限制缓冲区的选项。

我想知道的是,BodyContentImpl 实际上做了什么,是缓存标签或数据。 它将如何在动态变化的 jsp 中发挥作用。

I am using Tomcat version 5.0.28, i was analyzing the heap dump. It shows the memory leak is due to the BodyContentImpl objects, which seems (not sure) it caches the content of the jsp between the tags.
Also i found there is a problem in that version,It doesn't resets the buffer it uses internally to hold data. There is option to limit buffer in the later versions of tomcat.

What i want to know is, What BodyContentImpl actually do, Is that caches the tags or data.
how it will be useful in a dynamically changing jsp.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老子叫无熙 2024-10-15 02:08:48

是的,您的 JSP 标记内容已被缓存。具体来说,“JSP 自定义标记池 - 为 JSP 自定义标记实例化的 java 对象现在可以池化并重用。这显着提高了使用自定义标记的 JSP 页面的性能。”

禁用添加到 catalina.properties (或 catalina_opts)

org.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false
org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

将其关闭(但是,我不确定这是否曾经从 5.5.x 向后移植到 5.0.x)

请参见例如 Tomcat 5.5 配置

Yes, your JSP tag stuff is cached. Specifically "JSP Custom Tag Pooling - The java objects instantiated for JSP Custom Tags can now be pooled and reused. This significantly boosts the performance of JSP pages which use custom tags."

To disable add to catalina.properties (or catalina_opts)

org.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false
org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

to turn this off (However, I am not sure if this was ever backported to 5.0.x from 5.5.x)

See for example Tomcat 5.5 Configuration

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文