V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
y0
V2EX  ›  问与答

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

  •  
  •   y0 · 2013-07-11 22:16:24 +08:00 · 13006 次点击
    这是一个创建于 3933 天前的主题,其中的信息可能已经有所发展或是发生改变。
    买了个服务器, 1G 的内存,编译东西按说应该够了,安装相关的内容也没问题,但是编译了一阵就遇到

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

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

    P.S. 按照别人说的设置了 ulimit -v 10000000 啥的,还是遇到这类问题。
    3 条回复    2014-09-10 15:06:20 +08:00
    xdeng
        1
    xdeng  
       2013-07-11 22:20:23 +08:00   ❤️ 1
    swap??? 没设?
    y0
        2
    y0  
    OP
       2013-07-11 22:54:01 +08:00   ❤️ 1
    搞定了。

    # 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
        3
    herewei  
       2014-09-10 15:06:20 +08:00
    Adding --disable-fileinfo to ./configure solves the problem.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5335 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 09:10 · PVG 17:10 · LAX 02:10 · JFK 05:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.