小智 4
我认为 ulimit 就是您正在寻找的: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/ulimit.3.html
不过,ulimit 并不总是有效,这里提到了限制进程系统资源的替代方法: How to limit memory of a OS X program? ulimit -v 和 -m 都不起作用
这里也提出了同样的问题,所以这个问题可能会给问题带来一些启示,特别是关于虚拟内存: https://apple.stackexchange.com/questions/43371/way-to-limit-how-much-ram -任意过程可以占用
通过遵循此提示并使用 ulimit,您可能会得到硬限制: http://hints.macworld.com/article.php ?story=201106020948369