I have noticed for a while now that my system seems to be using up my memory much more quickly than I would expect. When it gets like this, I do notice it slowing down a bit at time, and my fan starts to spin aggressively (though maybe this latter thing is a separate issue?). I have tried googling around to understand what is going on (for example, I came across High memory usage that cannot be traced to a service or application and https://www.linuxatemyram.com/), but I haven't yet found a satisfying answer. What are reasons that my computer would be using much more memory (close to 100% of RAM and swap) than is reported by the running applications?
Currently, free -m
outputs
total used free shared buff/cache available
Mem: 15337 14538 386 14 411 454
Swap: 20480 15442 5038
A rough estimate of the amount of memory my running applications are using (computed with ps -o %mem ax | tail -n +2 | paste -sd+ | bc
) is 47.6%. Also, if I open up System Monitor and try manually adding up the amounts in the Memory column, then I again don't get a value close to the total reported amount of used memory.
Running arcstat -a
outputs
time hits miss read hit% miss% dhit dmis dh% dm% phit pmis ph% pm% mhit mmis mread mh% mm% arcsz size c mfu mru mfug mrug eskip el2skip el2cach el2el el2mfu el2mru el2inel mtxmis dread pread grow need free avail waste
13:14:22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5.0K 5.0K 479M 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 830M 235M 0
The output of running arc_summary
can be found here. I put it in pastebin since askubuntu limits the number of characters in this question.
I can't say I know how to parse all this output, but to my naive eyes, this doesn't seem to indicate much memory is being used by ARC caches (at least, the ARC size (current) row reports a small number). Also, zfs get comprresion
produces no output.
Similarly, running df -hl -t"tmpfs"
outputs the following, which again doesn't seem to account for much of my "missing" memory usage.
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.5G 4.0M 1.5G 1% /run
tmpfs 7.5G 260K 7.5G 1% /dev/shm
tmpfs 5.0M 8.0K 5.0M 1% /run/lock
tmpfs 7.5G 0 7.5G 0% /run/qemu
tmpfs 1.5G 228K 1.5G 1% /run/user/1000
If it helps, cat /proc/meminfo
outputs
MemTotal: 15705548 kB
MemFree: 672004 kB
MemAvailable: 838776 kB
Buffers: 2060 kB
Cached: 329484 kB
SwapCached: 258588 kB
Active: 3268524 kB
Inactive: 3574140 kB
Active(anon): 3095044 kB
Inactive(anon): 3439264 kB
Active(file): 173480 kB
Inactive(file): 134876 kB
Unevictable: 340 kB
Mlocked: 340 kB
SwapTotal: 20972540 kB
SwapFree: 4630972 kB
Zswap: 0 kB
Zswapped: 0 kB
Dirty: 452 kB
Writeback: 0 kB
AnonPages: 6253600 kB
Mapped: 191184 kB
Shmem: 22852 kB
KReclaimable: 194792 kB
Slab: 588360 kB
SReclaimable: 194792 kB
SUnreclaim: 393568 kB
KernelStack: 75888 kB
PageTables: 194976 kB
SecPageTables: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 28825312 kB
Committed_AS: 46712256 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 231560 kB
VmallocChunk: 0 kB
Percpu: 19776 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
FileHugePages: 0 kB
FilePmdMapped: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 11380384 kB
DirectMap2M: 4728832 kB
DirectMap1G: 0 kB
The only other thing I can think to add is a screenshot of the resources tab of System Monitor.
Let me know if there is anything else I can do to help figure out what's going on.