阿里云上遇到: virtual memory exhausted: Cannot allocate memory, 怎么破?

2013-07-11 22:16:24 +08:00
 y0
买了个服务器, 1G 的内存,编译东西按说应该够了,安装相关的内容也没问题,但是编译了一阵就遇到

virtual memory exhausted: Cannot allocate memory 这个问题。

搜了一下,好像挺普遍的。有谁有经验吗,怎么解决?

P.S. 按照别人说的设置了 ulimit -v 10000000 啥的,还是遇到这类问题。
13023 次点击
所在节点    问与答
3 条回复
xdeng
2013-07-11 22:20:23 +08:00
swap??? 没设?
y0
2013-07-11 22:54:01 +08:00
搞定了。

# dd if=/dev/zero of=/swap bs=1024 count=1M
Format the swap file:
# mkswap /swap
Enable the swap file:
# swapon /swap
Enable swap on boot:
# echo "/swap swap swap sw 0 0" >> /etc/fstab
herewei
2014-09-10 15:06:20 +08:00
Adding --disable-fileinfo to ./configure solves the problem.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/75494

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX