How to detect Out Of Memory condition?

Posted by Jaromir Hamala on Stack Overflow See other posts from Stack Overflow or by Jaromir Hamala
Published on 2009-08-25T08:42:31Z Indexed on 2010/12/22 19:54 UTC
Read the original article Hit count: 224

I have an application running on Websphere Application Server 6.0 and it crashes nearly every day because of Out-Of-Memory. From verbose GC is certain there are the memory leaks(many of them)

Unfortunately the application is provided by external vendor and getting things fixed is slow & painful process. As part of the process I need to gather the logs and heapdumps each time the OOM occurs.

Now I'm looking for some way how to automate it. Fundamental problem is how to detect OOM condition. One way would be to create shell script which will periodically search for new heapdumps. This approach seems me a kinda dirty. Another approach might be to leverage the JMX somehow. But I have little or no experience in this area and don't have much idea how to do it.

Or is in WAS some kind of trigger/hooks for this? Thank you very much for every advice!

© Stack Overflow or respective owner

Related posts about java

Related posts about memory-leaks