cannot allocate memory error

社会主义新天地 提交于 2019-12-08 03:18:32

问题


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:


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


来源:https://stackoverflow.com/questions/35025338/cannot-allocate-memory-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!