Reserve RAM in C
Posted
by petersmith221
on Stack Overflow
See other posts from Stack Overflow
or by petersmith221
Published on 2010-03-08T02:05:30Z
Indexed on
2010/03/08
2:12 UTC
Read the original article
Hit count: 726
Hi
I need ideas on how to write a C program that reserve a specified amount of MB RAM until a key [ex. the any key] is pressed on a Linux 2.6 32 bit system.
*
/.eat_ram.out 200
# If free -m is execute at this time, it should report 200 MB more in the used section, than before running the program.
[Any key is pressed]
# Now all the reserved RAM should be released and the program exits.
*
It is the core functionality of the program [reserving the RAM] i do not know how to do, getting arguments from the commandline, printing [Any key is pressed] and so on is not a problem from me.
Any ideas on how to do this?
© Stack Overflow or respective owner