代码之家  ›  专栏  ›  技术社区  ›  lucidquiet

如何解释这个内核消息:cgroupoutofmemory:Kill进程1234…score 1974还是牺牲子进程?

  •  1
  • lucidquiet  · 技术社区  · 7 年前

    所以,我在运行一个码头集装箱,它正在被杀死。

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

    由于实例将被重新启动,因此pid没有真正的帮助。我不知道该怎么处理这个问题 score 1974 部分。这是某种评级吗?这就是它需要降到的字节数吗?

    是否会因为系统中的其他东西挤压了这个容器而发出kill,或者 只有 这个容器加满了吗?

    1 回复  |  直到 7 年前
        1
  •  6
  •   Rico    7 年前

    我相信这个答案是真的 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的意思是“内存管理”。

    这里唯一的区别是,这个kill是由cgroups触发的,因为您可能遇到了内存限制。

    推荐文章