I'm using Tomcat 9 on a Centos 7 VPS. This server has run fine for two years, but recently crashes as if it's out of memory. The crash occurs between 1 hour and 24 hours after fresh Tomcat kill and start. I have also restarted my VPS. I removed all app logs, to be sure some limit wasn't being reached. There are no errors in any logs, and I've read through all similar issues going back to 2010.
The Eclipse MemoryAnalyzer seemed hopeful, so I added the HeapDumpOnOutOfMemoryError
flag to my setenv.sh
as shown:
export JAVA_OPTS="-Xms1500m -Xmx1500m -Xss512m -Xmn1000m -XX:+HeapDumpOnOutOfMemoryError"; echo "setenv.sh has set JAVA_OPTS: $JAVA_OPTS";
I also increased all mem params by 500m. But, no heap file was found in the JVM dir, or any other dir.
I am the only user of the site. And between crashes, I restore the main page as proof that TC is still alive, until the eventual crash.
TC hosts static content, and two WAR files. The crashes still occur whether I remove one, or both, of the WARs. I did update my static pages by changing the copyright year to 2021 (something I usually do in January, but forgot this year). I have pulled the original static files from backup, and it still crashes.
Can anyone offer some other ideas on how to track this down?