Does JVM reboot when 100% tenured heap is used

526 Views Asked by At

I've a test system where I see the tenured heap usage increase to 100% and then fall back to ~50%. This keeps happening continuously.

The application is started with following JVM args:

-Xms512M -Xmx512M -ea -XX:OnOutOfMemoryError=/bin/kill -9 %p

I don't see any logs that generally appear on application restart.

1

There are 1 best solutions below

6
On

Why are you killing the process on OutOfMemoryError? Instead why don't you collect the heap dump file and see why it's full?

Use: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/your/preferred/dumplocation

and open the resulting dumpfile with Eclipse MAT.

Also, I think the option needs to be quoted:

"-XX:OnOutOfMemoryError=kill -9 %p"

In reference to your question: No, the process will not restart - it will just terminate when the tenured heap is filled.