写一个shell来不停的消耗系统内存,来进行测试。
#!//bash
mkdir
/tmp/memory
mount
-t tmpfs -o size=1024M tmpfs
/tmp/memory
dd
if
=
//zero
of=
/tmp/memory/block
sleep
3600
rm
/tmp/memory/block
umount
/tmp/memory
rmdir
/tmp/memory
执行结果