2

Is there a way to detect a Java process is out of memory (e.g. PermGen space) and restart it with an SMF contract?

1 Answers1

1

Depends on your java VM. I you are using the hotspot vm you can do the following.

Use the -XX:OnOutOfMemoryError= java cli option to send the SIGKILL signal to the process, this will cause SMF to start it again, a SIGKILL is necessary because a OutOfMemory java process does not respond to any signals. You can add a -XX:-HeapDumpOnOutOfMemoryError option to get a dump of the heap to analyze, this can take up a lot of space though.

Documentation: http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

halldorhaf
  • 61
  • 3