Skip to content

vps 编译程序时virtual memory exhausted: Cannot allocate memory错误

2010 五月 16
by 荒野无灯

http://wiki.vpslink.com/Prevent:_Compiling_Yields_%27Cannot_allocate_memory%27

产生这个错误的原因是 gcc 编译器把整个服务器的物理内存当作目前服务器拥有的内存了,而不是VPS 的内存,因此,当它试图使用大于VPS 限制的大小的内存时,就报上面这个错误了。

1
2
3
4
5
6
7
8
9
10
#查看
ulimit -a

#设置为比vps限制小的一个值
ulimit -v 60000
#对于 debian 系统:
ulimit -m 60000

#设置为无限制
ulimit -v unlimited

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=3812

One Response Post a comment
  1. 五月 16, 2010

    最近,很多错误额。。。 :!: :!:

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS