Tomcat is failing to start with OOM even though there is enough memory in the system and all the required memory settings are provided properly. This is not happening consistently that proves there is no issue with tomact configuration.
15-Jan-2019 20:17:31.018 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /opt/tomcat/webapps/XWY.war has finished in 66,068 ms
15-Jan-2019 20:17:31.192 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-61480]
15-Jan-2019 20:17:31.305 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [https-jsse-nio-61443]
15-Jan-2019 20:17:31.362 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 252145 ms
15-Jan-2019 21:49:18.821 SEVERE [125] org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run Unexpected death of background thread ContainerBackgroundProcessor[StandardEngine[Catalina]]
java.lang.OutOfMemoryError: Java heap space
at java.util.TreeMap.put(TreeMap.java:577)
at java.util.TreeSet.add(TreeSet.java:255)
at java.util.AbstractCollection.addAll(AbstractCollection.java:344)
at java.util.TreeSet.addAll(TreeSet.java:312)
at org.apache.catalina.webresources.Cache.backgroundProcess(Cache.java:185)
at org.apache.catalina.webresources.StandardRoot.backgroundProcess(StandardRoot.java:601)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5564)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1373)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1345)
at java.lang.Thread.run(Thread.java:748)
Tomcat version is 8.5.8.
Java version:
_JAVA_OPTIONS: -Xms1024m -Xmx3072m openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-b12) OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode).