I’m using Docker via Kubernetes and setting a Memory limit that results in my container being run with the Docker -m memory setting. My hope was that a OOM condition would result in a SIGTERM being sent to the process and then a SIGKILL after a short grace period. Unfortunately my research seems to suggest that the kernel will impose the underlying cgroup configuration and kill the process with no chance of having time to cleanly exit the process.
Any chance I am missing something? Can a process have time to cleanly exit when it hits its memory constraint? I see there is a soft limit setting (not currently set). I don’t see any documentation that suggests a notification would be sent as a result of exceeding it.