ITeye博客

使用struts2时注意内存泄漏

7tianle · 2009-04-23 14:59 · Markdown

以前的项目用的是struts1,运行得好好的,现在改用struts2后,发现运行不到一天tomcat就出现内存溢出的错误。使用jProfiler分析一下,发现tomcat启动后使用的内存就一路飙升,而且放在action里面的类根本没有释放掉,应该是struts出现了问题,查一下struts的配置,原来没有配ActionContextCleanUp,在web.xml中加入 struts-cleanup org.apache.struts2.dispatcher.ActionContextCleanUp struts-cleanup /* 再次用jprofiler进行分析,果然好了。

评论(1)

  1. #1 楼 · lucy12 · 2016-04-29 17:23

    http://www.ulequ.com/lengxiaohua/ http://www.ulequ.com/lengxiaohua/16335.html http://www.ulequ.com/lengxiaohua/16334.html http://www.yulet.com/chengrenxiaohua/13374.html http://www.yulet.com/quanwen/13382.html

评论功能维护中,当前仅展示历史评论。