I have a Ubuntu 20.04 server which is reporting relatively low free RAM:
top - 11:28:31 up 5 days, 20:12, 3 users, load average: 0.18, 0.26, 0.27
Tasks: 268 total, 1 running, 267 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.3 sy, 0.0 ni, 99.5 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st
MiB Mem : 7786.5 total, 506.1 free, 1329.4 used, 5951.1 buff/cache
MiB Swap: 4096.0 total, 3965.5 free, 130.5 used. 6020.5 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
373096 root 20 0 8200 3996 3316 R 1.0 0.1 0:01.04 top
872 mysql 20 0 2843736 480140 15652 S 0.7 6.0 87:22.66 mysqld
563 root rt 0 280136 17940 8200 S 0.3 0.2 1:37.67 multipathd
745 syslog 20 0 224320 4812 3396 S 0.3 0.1 1:28.21 rsyslogd
1 root 20 0 169488 10424 6264 S 0.0 0.1 1:44.98 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.12 kthreadd
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-events_highpri
9 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
10 root 20 0 0 0 0 S 0.0 0.0 0:03.55 ksoftirqd/0
The server has 8GB of physical RAM and only 1.3GB free. The rest seems to be tied up in the buffer/cache. However, a list of running processes show that the highest consumer is the mysql daemon which is using only 6% of total RAM.
Is there a way to report the true memory consumption and how can I free up the buffer/cache?