Take the 2-minute tour ×

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.

share|improve this question
What operating system ? –  Paul R Jan 14 '11 at 8:52
Linux - CentOS more specifically –  Skkard Jan 14 '11 at 13:09
add comment

1 Answer

up vote 2 down vote accepted

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

share|improve this answer
add comment

Your Answer


