Change Mac OS X user Limits

如何修改max os x关于用户的配额限制,主要是进程数和文件句柄数。
I always had a process limitation problem on OSX. You may encounter this when you open too much applications. In my case, using iTerm, I easyily open far too much shells to servers I have to deal with.
You will then get a « login: fork: Resource temporarily unavailable » error message. When trying to start a new application, you will barely see the icon in the dock, then it will disapear. Now you’re in Troubble !
Hopefully, as OS X is a UNIX system, you have a solution. The only bad side is that you will have to reboot.
If you are running Leopard (10.5.x), using the first trick will lead you to the Windows Server not running… Pretty anoying. Use SSH and put back the Windowserver in its place. This is what I did, with the help of the blog at http://ruminate.net/pdm :
Sudo -s to get a root shell. Then create the two files like :
[quote]/etc/launchd.conf[/quote]

cat /etc/launchd.conf

limit maxproc 512 2048
limit maxfiles 512 unlimited

[quote]/etc/sysctl.conf[/quote]

cat /etc/sysctl.conf

# Turn up maxproc
kern.maxproc=2048

# Turn up the maxproc per user
kern.maxprocperuid=1024

# Remove core files
kern.coredump=0

After a reboot, your max user process will be raised to 512 :

ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) 6144
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 512
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 512
virtual memory (kbytes, -v) unlimited
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值