I am using marathon to deploy my docker containers with memory limits specified in marathon specs which looks like :
{
"id": "<name>",
"cmd": null,
"cpus": 2,
"mem": 4096,
"disk": 30720,
"instances": 1,
"container": {
"docker": {
"image": "<docker-image>",
"network": "HOST",
"privileged": true,
"forcePullImage": true
},
"requirePorts": true,
"ports": [<port>],
"type": "DOCKER"
}
}
But after running for about 2-3 hours it encounters out of memory issue and OOM killer kills few tasks but leads to my server being in completely frozen state. I can't ssh or access any service on it. It is required to completely restart machine from that state to make it work normally.
I checked syslog and they appear to be as :
My question is how to avoid this? What can be done to prevent from this occurring?