I have a Fedora 30 [5.6.13-100.fc30.x86_64]
machine with 32GB of RAM onboard.
Right after boot both free -h
and htop
indicate that 21-22GB is used:
[ andriim@dev-r-vrt-007 ~/work ] $ free -h
total used free shared buff/cache available
Mem: 31Gi 22Gi 6.1Gi 2.0Mi 3.2Gi 8.8Gi
Swap: 2.0Gi 344Mi 1.6Gi
At the same time, all of the processes I can find in htop
combined don't use nearly that much RAM. If I sort by resident memory usage, top 10 processes use around 300MB combined.
I tried finding the sum of RAM actually used by all processes and it also turned out to be nowhere close to 21GB:
[ root@dev-r-vrt-007 /tmp ] # ps aux | awk '{sum=sum+$6}; END {print sum/1024 " MB"}'
437.898 MB
Then I thought, maybe the issue is related to Kernel SLAB cache. That, however, doesn't seem to be the case either:
[ root@dev-r-vrt-007 ~ ] # slabtop -s c -o | head -n 12
Active / Total Objects (% used) : 3742847 / 3777379 (99.1%)
Active / Total Slabs (% used) : 75950 / 75950 (100.0%)
Active / Total Caches (% used) : 105 / 150 (70.0%)
Active / Total Size (% used) : 625537.34K / 637690.48K (98.1%)
Minimum / Average / Maximum Object : 0.01K / 0.17K / 17.31K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
47552 47531 99% 2.00K 2972 16 95104K kmalloc-2k
1267328 1267252 99% 0.06K 19802 64 79208K vmap_area
593544 593484 99% 0.09K 14132 42 56528K kmalloc-96
90376 87689 97% 0.59K 3476 26 55616K inode_cache
95168 94892 99% 0.50K 2974 32 47584K kmalloc-512
Well, then, maybe HugePages are reserving the missing RAM? It seems they don't:
[ root@dev-r-vrt-007 ~ ] # cat /proc/meminfo | grep Huge
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
FileHugePages: 0 kB
HugePages_Total: 16
HugePages_Free: 16
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 1048576 kB
Hugetlb: 16777216 kB
I'm out of ideas. Any suggestions where else to look for the lost RAM?