跳到主要内容
版本:0.17.0+

linux-monitor

overview

memory

check memory stat (free)

➜  ~ free -g
total used free shared buff/cache available
Mem: 108 78 7 0 21 28
Swap: 15 0 15

check memory stat with details (htop)

picture 1

If we look at htop memory usage carefully, we may find that the memory usage doesn't add up to the processes.

It is mainly because zfs uses 50% (default) of memory as cache.

see:

check zfs arc (arc_summary)

see: - ram - Is ZFS on Ubuntu 20.04 using a ton of memory? - Ask Ubuntu

$ arc_summary

------------------------------------------------------------------------
ZFS Subsystem Report Thu Sep 08 22:56:19 2022
ARC Summary: (HEALTHY)
Memory Throttle Count: 0

ARC Misc:
Deleted: 97.48m
Mutex Misses: 13.77k
Evict Skips: 4.02m

ARC Size: 88.42% 47.82 GiB
Target Size: (Adaptive) 88.48% 47.85 GiB
Min Size (Hard Limit): 6.25% 3.38 GiB
Max Size (High Water): 16:1 54.08 GiB

modify zfs config file

sudo vim /etc/modprobe.d/zfs.conf

QA: why memory usage does not add up with processes

see: check memory stat with details (htop)