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 availableMem: 15337 14538 386 14 411 454Swap: 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 waste13: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 ontmpfs 1.5G 4.0M 1.5G 1% /runtmpfs 7.5G 260K 7.5G 1% /dev/shmtmpfs 5.0M 8.0K 5.0M 1% /run/locktmpfs 7.5G 0 7.5G 0% /run/qemutmpfs 1.5G 228K 1.5G 1% /run/user/1000
If it helps, cat /proc/meminfo
outputs
MemTotal: 15705548 kBMemFree: 672004 kBMemAvailable: 838776 kBBuffers: 2060 kBCached: 329484 kBSwapCached: 258588 kBActive: 3268524 kBInactive: 3574140 kBActive(anon): 3095044 kBInactive(anon): 3439264 kBActive(file): 173480 kBInactive(file): 134876 kBUnevictable: 340 kBMlocked: 340 kBSwapTotal: 20972540 kBSwapFree: 4630972 kBZswap: 0 kBZswapped: 0 kBDirty: 452 kBWriteback: 0 kBAnonPages: 6253600 kBMapped: 191184 kBShmem: 22852 kBKReclaimable: 194792 kBSlab: 588360 kBSReclaimable: 194792 kBSUnreclaim: 393568 kBKernelStack: 75888 kBPageTables: 194976 kBSecPageTables: 0 kBNFS_Unstable: 0 kBBounce: 0 kBWritebackTmp: 0 kBCommitLimit: 28825312 kBCommitted_AS: 46712256 kBVmallocTotal: 34359738367 kBVmallocUsed: 231560 kBVmallocChunk: 0 kBPercpu: 19776 kBHardwareCorrupted: 0 kBAnonHugePages: 0 kBShmemHugePages: 0 kBShmemPmdMapped: 0 kBFileHugePages: 0 kBFilePmdMapped: 0 kBHugePages_Total: 0HugePages_Free: 0HugePages_Rsvd: 0HugePages_Surp: 0Hugepagesize: 2048 kBHugetlb: 0 kBDirectMap4k: 11380384 kBDirectMap2M: 4728832 kBDirectMap1G: 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.