duanquan1207 2016-01-26 22:32
浏览 62
已采纳

无法分配内存错误

I just ported my app over from python so I'm a bit new to Go. It seems I am having a memory issues. getAudioOnlyInfo: fork/exec /usr/local/bin/youtube-dl: cannot allocate memory.

This is run on a ubuntu machine. Via supervisor.

Edit:

setting the sysctl -w vm.swappiness=1 resolve the issue

  • 写回答

1条回答 默认 最新

  • dqg63264 2016-01-27 01:26
    关注

    For anyone else who runs into this problem, it was a related recent issue in the golang issue

    For all those affected, temporary workaround on Linux until it is fixed properly can be one of following:

    1. enable unconditional overcommit: sysctl -w vm.overcommit_memory=1
    2. enable unconditional overcommit: sysctl -w vm.overcommit_memory=1 add swap to your host, with sysctl -w vm.swappiness=1 it will almost never going to be used, but it participates in calculations where Linux kernel decides to whether it can afford to satisfy allocation or not when default overcommit_memory=0 is in use
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?