BodyContentImpl jsp标签内存泄漏问题
我使用的是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您的 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