I am trying to create a programming judge like spoj.pl. I have to measure the time and memory a C/C++/Java program is using. I want to set a maximum memory limit for the program that I wish to execute. Can you please suggest how I can do that.
Share
System-, where-, how-, what-,…- dependent.
To limit, i.e.:
Linux command line: >
$ ulimit -v NNN && ./tha_prog,$ man ulimit,$ ulimit -a.Linux C coded: >
setrlimit()linux.die: setrlimit, opengroup:setrlimitWindows:
CreateJobObject, Job ObjectsThen the question also becomes what to limit. Static vs dynamic libraries etc.
To profile:
Valgrind with callgrind, – and ie kcachegrind, +++.