Search code examples
javadockermarathondcos

Why does Docker kill jvm?


I use DCOS with Spring boot applications inside Docker containers. I noticed that sometimes containers are killed, but there are no errors in the container logs, only:

Killed
W1114 19:27:59.663599 119266 logging.cpp:91] RAW: Received signal SIGTERM 
from process 6484 of user 0; exiting

HealthCheck is enabled only for SQL connection and disk space. The disk is ok on all nodes, in case of SQL problems error should appear in the logs. Other reason could be the memory but it also looks fine. From marathon.production.json:

"cpus": 0.1,
"mem": 1024,
"disk": 0

And docker-entrypoint.sh:

java -Xmx1024m -server -XX:MaxJavaStackTraceDepth=10 -XX:+UseNUMA 
  -XX:+UseCondCardMark -XX:-UseBiasedLocking -Xms1024M -Xss1M 
  -XX:MaxPermSize=128m -XX:+UseParallelGC -jar app.jar

What could be the reason for container killing and are there any logs on DCOS regarding it?


Solution

  • Solved with java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap