本文介绍了不能分配内存错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我刚刚从python移植了我的应用程序,所以我对Go有点新。看来我有一个内存问题。 code>解决问题解决方案对于遇到此问题的其他人,这是一个相关的近期问题 golang问题 对于所有受影响的人员,Linux上的临时解决方法直到它正确地修复为止,可以是以下之一: 启用无条件overcommit: sysctl -w vm.overcommit_memory = 1 启用无条件overcommit: sysctl -w vm.overcommit_memory = 1 将交换添加到您的主机,使用 sysctl -w vm.swappiness = 1 它将几乎永远不会被使用,但它参与计算,其中 Linux内核决定它是否可以满足分配,或者当$ 默认overcommit_memory = 0 c>正在使用中 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 解决方案 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: enable unconditional overcommit: sysctl -w vm.overcommit_memory=1 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 这篇关于不能分配内存错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-30 07:30