如何解释这个内核消息:cgroup out of memory: Kill process 1234 .... score 1974 or sacrific child?

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

所以,我是 运行 一个正在被杀死的 docker 容器。

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

pid 并没有真正帮助,因为实例将重新启动。我不确定如何处理 score 1974 部分。那是某种评级吗?这是它需要下降到的字节数吗?

可能是因为系统上的其他东西正在挤压这个容器,或者这个只有这个容器已经满了吗?

还有牺牲子部分,我认为这与某种子流程有关?

我相信这实际上是回答 here

如果检查Linux内核代码here。你会看到:

/*
 * 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 表示 'Memory Management'.

这里唯一的区别是这个杀戮是由 cgroups 触发的,因为你可能 运行 进入内存限制。