小编pet*_*221的帖子

在C中保留RAM

我需要有关如何编写一个C程序的想法,该程序保留指定数量的MB RAM直到一个键[ex.在Linux 2.6 32位系统上按下任意键.

*
/.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.
*
Run Code Online (Sandbox Code Playgroud)

它是程序的核心功能[保留RAM]我不知道怎么做,从命令行获取参数,打印[按任意键]等等对我来说不是问题.

关于如何做到这一点的任何想法?

c linux memory ram

10
推荐指数
2
解决办法
1731
查看次数

标签 统计

c ×1

linux ×1

memory ×1

ram ×1