查找服务器一个内存溢出的bug

最近两天晚上以每分钟一次的频率进行热更新,测试这种压力程度是否会引起bug。

早上到公司一看服务器已经死掉了,提示outofmemory,看来应该是有一个内存举出的地方。

服务器直接挂掉,连dump内存都无法成功。

使用jprofiler观察内存中的对象时时变化。

jprofiler中发现classloader没有被释放掉?

google之:

http://zeroturnaround.com/rebellabs/rjc201/

http://frankkieviet.blogspot.com/2006/10/how-to-fix-dreaded-permgen-space.html

Classloader leaks I – How to find classloader leaks with Eclipse Memory Analyser (MAT)

得知:classloader中会引用所加载类中的静态属性,从而导致classloader内存泄露。

将内存dump出来后,使用clipse Memory Analyser (MAT),查看具体哪里泄露。

直接在eclipse 中查找memory analyser 出来好多个软件。

mat 的update site:http://download.eclipse.org/mat/1.3.1/update-site/

其它的memory analyser软件,有时间再去了解下。

 

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>