OutOfMemoryError on jdk 5
I have inherited a java enterprise app from another developer who left the company (probably a bad start ),
And i am noticing some OutOfMemory in the logs once in a while.
My environment is jdk5 update 11, jboss 4.05GA, Redhat 9.
I was thinking on how to go about troubleshooting this -
I added a flag -XX:+HeapDumpOnOutOfMemoryError, but we saw that this did not create a heap dump when the error happened.
Further the weird thing is that the jboss/jvm does not crash after this OutOfMemoryError and continues serving request normally
and even when we check the memory on the process everything looks normal.
(There is a delay of a couple of minutes from the time we get an EMail notification for it and when we check the logs)
We have just added jmxremote.port option for jvm startup so we can start a remote jconsole, but this happens probably once a week so until then we wait patiently
(or can we do something in the meanwhile).
I cant upgrade to jdk 6 (jdk 6 gives a stack trace with an outofmemory error which could be helpful)
So the questions i have in my mind are -
1. Can a jvm recover from an OutOfMemoryError ? via GC
2. Isnt it necessary for an OutOfMemoryError to crash the jvm ?
3. Is is possible that some lib is catching this error an ignoring it ?
4. Can I do something, to debug this other than wait for it to happen again?
5. How do i make sure i am not running into this -
"The parallel garbage collector (UseParallelGC) throws an out-of-memory exception if an excessive amount of time is being spent collecting a small amount of the heap."
documented here - https://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html