AJAX4JSF/AjaxStateHolder | AJAX4JSF/AjaxStateHolder | AJAX4JSF/AjaxStateHolder会话内存泄漏
我正在对一个大约有 300 个并发用户的企业 Web 应用程序进行性能调整。我从 GC 日志中注意到,即使在 Full GC 之后,应用程序堆也始终在增长,并且对象始终在累积。我已经获得了生产堆转储,令我惊讶的是会话对象占据了堆大小的 90% 以上!这都是因为 AjaxStateHolderObject。
该应用程序在 JSF 1.X 和 RichFaces 3.3.0 上运行。
在开始讨论之前,我尝试了以下操作:
- 将以下代码添加到 web.xml
<参数值>1
- 将以下代码添加到 web.xml
- 升级自RichFaces 3.3.0 到 3.3.3
以上尝试均未能解决内存泄漏问题。
更新
*由于 AjaxStateHolder 尺寸巨大,单个用户会话最多可消耗 25 MB。
*应用程序的大多数托管bean都是请求范围,会话中没有未使用的引用对象,唯一与内存有关的问题是ajaxStateHolder。
预先感谢您的任何指导。
任何形式的帮助将不胜感激,因为我在网上没有找到任何有关此问题的信息。
I am working on the performance tuning of an enterprise web application with about 300 simultaneous user. I have noticed from the GC log that the application heap is always growing and objects are always accumulating even after Full GC. I've acquired a production heap dump and I was surprised that the session objects are occupying more than 90% of the heap size! That's all because of the AjaxStateHolderObject.
The application is runing on JSF 1.X and RichFaces 3.3.0.
Before starting this discussion I tried the following:
- Added the following code to web.xml
<context-param>
<param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
<param-value>1</param-value>
</context-param>
- Added the following code to web.xml
<context-param>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>1</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.numberOfLogicalViews</param-name>
<param-value>1</param-value>
</context-param>
- Upgraded from RichFaces 3.3.0 to 3.3.3
All the above attempts failed to solve the memory leakage problem.
Updates
*A single user session can consume up to 25 MB because of the AjaxStateHolder huge size.
*Most of the managed beans of the application are request scope and there is no unused referenced objects in session, the only problem concerning memory is the ajaxStateHolder.
Thanks in advance for any guidance.
Any kind of help will be appreciated because I didn't find anything concerning this issue on the web.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎遇到了 JSF/a4j 会话内存泄漏缺陷。有关此事的更多说明,请参阅下面的链接:
https://issues.jboss.org/browse/RF -3878
看起来好像视图状态正在会话中缓存并且没有清理。这是 a4j 的一个错误,无法修复,只能解决。您添加到
web.xml
的配置是唯一建议的解决方法,但显然这没有太大帮助。看起来 a4j 的可扩展性不是很好,所以也许最好的长期解决方案是慢慢地将 a4j 组件从应用程序中重构出来,并用不同的组件框架替换它们?抱歉,我无法为您提供更多帮助,祝您好运。
It seems that you have run into the JSF/a4j session memory leak defect. See link below for more description on the matter:
https://issues.jboss.org/browse/RF-3878
It appears as if the view state is being cached in session and not cleaned up. It is a bug with a4j and cannot be fixed, just worked around. The configurations you added to
web.xml
are the only suggested workaround but apparently this does not help too much.It seems a4j is not very scalable so perhaps the best long term solution is to slowly refactor the a4j components out of the application and replace them with a different component framework? Sorry I could not be more of a help and I wish you luck.