使用stress-ng进行内存压力测试,使用free -h未看到内存空间减少对应大小
在飞腾2000+环境上使用如下命令进行压力测试:
stress-ng --vm 2 --vm-bytes 10G --vm-keep &
执行命令前使用free -h查询内存空间:
[root@localhost stress-ng-0.14.03]# free -h
total used free shared buff/cache available
Mem: 122Gi 3.3Gi 118Gi 60Mi 1.3Gi 109Gi
Swap: 4.0Gi 0B 4.0Gi
执行命令:
[root@localhost stress-ng-0.14.03]# stress-ng --vm 2 --vm-bytes 10G --vm-keep &
[1] 3867444
[root@localhost stress-ng-0.14.03]# stress-ng: info: [3867444] defaulting to a 86400 second (1 day, 0.00 secs) run per stressor
stress-ng: info: [3867444] dispatching hogs: 2 vm
执行命令后使用free -h查询内存空间:
[root@localhost stress-ng-0.14.03]# free -h
total used free shared buff/cache available
Mem: 122Gi 13Gi 108Gi 63Mi 1.3Gi 99Gi
Swap: 4.0Gi 0B 4.0Gi
可以看到内存空间只减少了一个10g,为什么?