y0
V2EX  ›  问与答

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

  •  
  •   y0 · Jul 11, 2013 · 14151 views
    This topic created in 4697 days ago, the information mentioned may be changed or developed.
    买了个服务器, 1G 的内存,编译东西按说应该够了,安装相关的内容也没问题,但是编译了一阵就遇到

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

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

    P.S. 按照别人说的设置了 ulimit -v 10000000 啥的,还是遇到这类问题。
    3 replies    2014-09-10 15:06:20 +08:00
    46fo
        1
    46fo  
       Jul 11, 2013   ❤️ 1
    swap??? 没设?
    y0
        2
    y0  
    OP
       Jul 11, 2013   ❤️ 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  
       Sep 10, 2014
    Adding --disable-fileinfo to ./configure solves the problem.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5138 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 63ms · UTC 01:17 · PVG 09:17 · LAX 18:17 · JFK 21:17
    ♥ Do have faith in what you're doing.