How to interpret this kernel message: cgroup out of memory: Kill process 1234 .... score 1974 or sacrifice child?

10/4/2018

So, I'm running a docker container that's getting killed.

Memory cgroup out of memory: Kill process 1014588 (my-process) score 1974 or sacrifice child

The pid doesn't really help since the instance will be restarted. I'm not sure what to make of the score 1974 portion. Is that some kind of rating? Is that the number of bytes it needs to drop to?

Could the kill be issued because of other things on the system that are squeezing this container, or can this only this container is topped out?

And the sacrifice child part, I think that would be in regards to some kind of subprocess?

-- lucidquiet
containers
kubernetes
out-of-memory

1 Answer

10/4/2018

I believe this is actually answered here

If you check the Linux kernel code here. You'll see:

/*
 * If any of p's children has a different mm and is eligible for kill,
 * the one with the highest oom_badness() score is sacrificed for its
 * parent.  This attempts to lose the minimal amount of work done while
 * still freeing memory.
 */

mm means 'Memory Management'.

The only difference here is that this kill is getting triggered by cgroups because you have probably run into memory limits.

-- Rico
Source: StackOverflow