I've written a program for a class that my professor will be testing in various low memory environments to see how it behaves when the program runs out of memory. Is there a way I can simulate the execution in a low memory environment without creating a virtual machine?

link|improve this question
feedback

1 Answer

up vote 4 down vote accepted

You'll want to use ulimit

link|improve this answer
is there something that does something similar on a single user basis? I don't have the permission to make system wide changes. – user20222 Apr 24 '10 at 11:51
@user20222: You can use ulimit at the command line or in a script in Bash. – Dennis Williamson Apr 24 '10 at 13:20
I'm getting-- ulimit: max memory size: cannot modify limit: Operation not permitted – user20222 Apr 24 '10 at 13:32
What exactly did you try? Post the command line you used – basszero Apr 25 '10 at 17:12
"ulimit -m 1000" and "ulimit -H -m 1000". I also did this: "ulimit -S -m 1000" which didn't error, but it did not enforce the memory limit for the program. – user20222 Apr 26 '10 at 2:44
show 3 more comments
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.