戈兰 : panic before malloc heap initialized

标签 go vagrant archlinux

我在我的 Vagrant 框架的 $GOPATH 中运行 go build
但它打印出来

 runtime: panic before malloc heap initialized
 fatal error: runtime: cannot allocate heap metadata

盒子是3.10.9-1-ARCH x86_64,内存242M。

为什么我无法在框中构建 go 文件?

提前致谢。

最佳答案

看来这是虚拟内存不足造成的

$ ulimit -v 242000
$ go build prog.go
runtime: panic before malloc heap initialized
fatal error: runtime: cannot allocate heap metadata

64位go需要大量virtual memory space but not necessarily that much real memory .

您可以通过向容器分配更多内存来解决此问题。

您还可以使用 /proc/sys/vm/overcommit_memory 的设置。

您还可以尝试将交换空间分配给容器(如果可能)。

关于戈兰 : panic before malloc heap initialized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18549324/

相关文章:

archlinux - 在 Arch linux 上安装全局时出错

linux - 从 Sourcery CodeBench 去哪里 **LITE**

arrays - 在 Go 中,如何将结构转换为字节数组?

戈朗 : Different AppEngine packages

debugging - 去测试调试

ubuntu - 从用户 shell 执行命令的 Ansible 剧本

linux - 停止或重新加载后 Vagrant 错误 "Failed to mount folders in Linux guest"

centos - 如果我的 CentOS 7.2 机器有 vagrant 1.7.2,我可以只运行 1.8.1 rpm 来获得 vagrant 1.8.1 吗?

go - 如何解析 JSON 整数数组

erlang - 如果不指定节点名称,iex 和 erl 启动速度会非常慢