一开始以为使用 free -h
得到的就是docker 容器本身的内存使用情况
#容器
root@feb0423bbe52:/sys/fs/cgroup/memory# free -h
total used free shared buff/cache available
Mem: 62G 21G 267M 423M 41G 40G
Swap: 5.0G 834M 4.2G
看到这个结果产生了疑问,因为和宿主机一模一样啊!
#宿主机
[root@mh-server-22 ~]# free -h
total used free shared buff/cache available
Mem: 62G 19G 1.2G 337M 41G 42G
Swap: 5.0G 835M 4.2G
<