我有一个Go程序,希望在交换机上运行。由于无法在交换机上安装Go,因此我只需复制可执行文件并尝试运行即可。但是我得到了以下错误信息。
runtime: panic before malloc heap initialized
fatal error: runtime: cannot reserve arena virtual address space
runtime stack:
runtime.throw(0x8149b8b)
/usr/local/go/src/pkg/runtime/panic.c:520 +0x71
runtime.mallocinit()
/usr/local/go/src/pkg/runtime/malloc.goc:552 +0xf2
runtime.schedinit()
/usr/local/go/src/pkg/runtime/proc.c:150 +0x3a
_rt0_go()
/usr/local/go/src/pkg/runtime/asm_386.s:95 +0xf6`
我该如何将Go可执行文件与其所有依赖项打包? 编辑1: 这里是
ulimit -a
的输出结果。core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 40960
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) 395067
file locks (-x) unlimited
ulimit -a
命令,查看虚拟内存、最大内存或数据段是否有任何限制。 - nos