Hi,
sometimes my geoserver crashes with this error:
Jun 07 08:49:35 user01 sh[27016]: java.lang.OutOfMemoryError: Java heap space
Jun 07 08:49:35 user01 sh[27016]: Dumping heap to java_pid27016.hprof ...
Jun 07 08:49:41 user01 sh[27016]: Heap dump file created [1725499167 bytes in 5,339 secs]
I actually don't know why this happens but that's not the matter here.
The point is, when the OutOfMemoryError occurs, there's no exit code provided, so my systemd service does not restart the geoserver instance.
Is there any solution for this? Not sure if maybe the -XX:OnError option is the solution.
Thanks,
Volkan
On 07-06-16 14:13, Volkan Gümüs wrote:
Hi,
sometimes my geoserver crashes with this error:
Jun 07 08:49:35 user01 sh[27016]: java.lang.OutOfMemoryError: Java heap
space
Jun 07 08:49:35 user01 sh[27016]: Dumping heap to java_pid27016.hprof ...
Jun 07 08:49:41 user01 sh[27016]: Heap dump file created [1725499167
bytes in 5,339 secs]
I actually don't know why this happens but that's not the matter here.
The point is, when the OutOfMemoryError occurs, there's no exit code
On OOM error the jvm may continue running in other threads than the one tha caused the error, so you want to add a -XX:OnOutOfMemoryError="kill -9 $PPID" or -XX:OnOutOfMemoryError="kill -9 %p" option to force-kill the jvm, which should generate an exitcode and lets you restart.
Mark