Tuesday, March 29, 2022

[SOLVED] Java service auto kill on linux

Issue

I have ran nohup java -jar sample.jar & on my linux server as a backend service of web application but service is automatically killed after few hours and need to re-run the command. I want to know what is the reason and how to resolve the issue


Solution

I run Spring Boot via the same command and only a handful of times have I seen this behavior. It turned out that the JVM ran out of memory and it crashed. When I changed the heap size settings it was rock solid again.



Answered By - gshauger
Answer Checked By - David Marino (WPSolving Volunteer)