Limiting RAM usage for program executed through shell script

♀尐吖头ヾ 提交于 2020-02-25 09:08:20

问题


I need to limit the memory(RAM) usage of a program to just 100mb. I am executing a batch of them using a shell script and wanted to know how to do that. I am compiling from source of my class and then storing the real run time using the time command. Just wanted to know how to limit the memory usage of each to 100mb.


回答1:


You can play around with ulimit -m. Type help ulimit and/or type ulimit -a to get a full list



来源:https://stackoverflow.com/questions/4689259/limiting-ram-usage-for-program-executed-through-shell-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!