如何解决生产系统中的Out Of Memory错误 [英] How to troubleshoot Out Of Memory error on Production system

查看:238
本文介绍了如何解决生产系统中的Out Of Memory错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在Windows上使用JBoss_4_0_4_GA和JDK 1.5.0(无更新)

We are using JBoss_4_0_4_GA with JDK 1.5.0 (no updates) on a Windows

JBoss服务器在Wrapper(版本3.2.3)中运行 http://wrapper.tanukisoftware.org

The JBoss server is run within a Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org.

自从JVM太老了我甚至无法在JVM上使用-XX:+ HeapDumpOnOutOfMemoryError选项。

Since the JVM is so old I cannot even use the -XX:+HeapDumpOnOutOfMemoryError option on the JVM.

我有什么选择来找出问题?

What are my option to find out the issue?

像往常一样,内存不足异常发生在应用程序的不同部分。

As usual the Out of Memory exception is happening on different parts of the application.

我没有自由升级JVM立即。

I do not have the liberty to upgrade the JVM right away.

    The current VM settings
    Java Additional Parameters
    wrapper.java.additional.1=-Xms512m
    wrapper.java.additional.2=-Xmx1024m
    wrapper.java.additional.3=-Dsun.rmi.dgc.client.gcInterval=3600000
    wrapper.java.additional.4=-Dsun.rmi.dgc.server.gcInterval=3600000
    wrapper.java.additional.5=-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser
    wrapper.java.additional.6=-Djava.endorsed.dirs=D:/jboss-4.0.4.GA/lib/endorsed

例外的片段


INFO | jvm 1 | 2012/05/31 11:25:03 | 11:25:03,502 ERROR [SOAPFaultExceptionHelper] SOAP请求异常INFO | jvm 1 | 2012/05/31 11:25:03 | java.rmi.RemoteException:java.lang.OutOfMemoryError:Java堆空间;嵌套异常是:INFO | jvm 1 | 2012/05/31 11:25:03 | java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:Java堆空间

INFO | jvm 1 | 2012/05/31 11:25:03 | 11:25:03,502 ERROR [SOAPFaultExceptionHelper] SOAP request exception INFO | jvm 1 | 2012/05/31 11:25:03 | java.rmi.RemoteException: java.lang.OutOfMemoryError: Java heap space; nested exception is: INFO | jvm 1 | 2012/05/31 11:25:03 | java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space

INFO | jvm 1 | 2012/05/31 11:25:03 |引起:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:Java堆空间INFO | jvm 1 | 2012/05/31 11:25:03 | at java.util.concurrent.FutureTask $ Sync.innerGet(FutureTask.java:205)INFO | jvm 1 | 2012/05/31 11:25:03 | at java.util.concurrent.FutureTask.get(FutureTask.java:80)

INFO | jvm 1 | 2012/05/31 11:25:03 | Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space INFO | jvm 1 | 2012/05/31 11:25:03 | at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205) INFO | jvm 1 | 2012/05/31 11:25:03 | at java.util.concurrent.FutureTask.get(FutureTask.java:80)


推荐答案

您可以尝试使用 jmap 进行内存转储(在标签中你提到 java 5 所以这应该是可能的)。当服务器仍然工作时(例如每小时左右)进行多次转储。

You can try to do memory dumps with jmap (in tags you mentioned java 5 so this should be possible). Do several dumps when the server still works (like every hour or so).

然后在 Eclipse MAT 。搜索在每个转储上变大的对象或对象集合。这很可能是你的内存泄漏。

Then analyze them in Eclipse MAT. Search for objects, or collections of objects that grow bigger on every dump. This will most probably be your memory leak.

这篇关于如何解决生产系统中的Out Of Memory错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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