如何释放记忆? [英] How to free up memory?

查看:244
本文介绍了如何释放记忆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的App服务器已经面临Out of Memory错误。我们看到使用的堆大小逐渐增加,直到最终达到可用堆的大小。这种情况每3周发生一次,之后需要重新启动服务器才能解决此问题。
在分析堆转储时,我们发现问题是JSP中使用的对象。

We have been facing Out of Memory errors in our App server for sometime. We see the used heap size increasing gradually until finally it reaches the available heap in size. This happens every 3 weeks after which a server restart is needed to fix this. Upon analysis of the heap dumps we find the problem to be objects used in JSPs.

JSP对象能否成为Appserver内存问题的真正原因?我们如何释放JSP对象(使用usebean或其他标签实例化的对象)?

Can JSP objects be the real cause of Appserver memory issues? How do we free up JSP objects (Objects which are being instantiated using usebean or other tags)?

我们有一个带有2个节点和IHS的集群Websphere应用服务器。

We have a clustered Websphere appserver with 2 nodes and an IHS.

编辑:上述调查结果基于下面给出的使用IBM支持助手的堆转储和nativestderr日志分析

The findings above are based on the heap-dump and nativestderr log analysis given below using the IBM support assistant

nativestd错误日志分析:

nativestd err log analysis:

替代文字http://saregos.com/wp-content/uploads/2010/03/chart.jpg

堆转储分析:

![alt text] [2]

![alt text][2]

堆转储分析显示直接支配者(2级以上)上图中的hastable条目)

Heap dump analysis showing the immediate dominators (2 levels up of hastable entry in the image above)

![替代文字] [3]

![alt text][3]

最后一张图片显示直接支配者实际上是在JSP中使用的对象。

The last image shows that the immediate dominators are in fact objects being used in JSPs.

EDIT2:更多信息可在 http://saregos.com/?p=43

More info available at http://saregos.com/?p=43

推荐答案

手动触发垃圾回收无法解决您的问题 - 它不会释放仍在的资源使用。

Triggering the garbage collection manually doesn't solve your problem - it won't free resources that are still in use.

您应该使用分析工具(如jProfiler)来查找泄漏。您可以使用代码来存储在运行时期间未发布的列表或映射中的引用 - 可能是静态引用。

You should use a profiling tool (like jProfiler) to find your leaks. You problably use code that stores references in lists or maps that are not released during runtime - propably static references.

这篇关于如何释放记忆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆