32GB of RAM in the computer.
Before: 32GB of RAM would always fill up - I’d have about 1-2GB free , the rest would be buff/cache.
Now: 20GB free, 9GB buff/cache.
What changed: physically removed two SSD drives from the computer’s SATA ports.
Does this make sense to anyone? Computer seems to work better now too.
Very slow SSD’s could use a lot of “buff/cache”, but that makes me wonder about those drives and your workload. I have years of experience with large-scale batch processing making relatively trivial (e.g., light processor load – e.g., rescaling data from byte to float32) and have encountered many ways to bring a system to a halt with large buff/cache demands.
But the buff/cache stayed like that for days. It would ramp up very quickly and then just float at almost full for days, even if there was nothing going on. Right now, used+buff/cache RAM goes up with demand (if I open more tabs) and goes down when I stop using something (if I close those opened tabs for example). Before, it would just stay full (used+buff/cache).
Oh, and I didn’t even use those two SSDs to boot an OS!
And just to highlight, SSDs were using SATA ports, and now SATA ports are not used.
used will go down if the process that used ram exits.
buff/cache will go down if storage is umounted or there is memory pressure from elsewhere in the system.
Something was using them – and apparently pretty heavily.
Is it possible that SSD optimization feature forces stuff to remain in buff/cache for as long as possible without clearing? Or something like that?
You haven’t mentioned what data was going to the drives and what programs were used. Some software is very aggressive about saving and rewriting large files after making tiny changes. In my former work we always bought low-end CPU’s because even a stripped filesystem with multiple drives couldn’t keep ahead of the write operations. SSD’s should be faster, but CPU speeds are much faster.
I didn’t even boot from the drives.
Does anyone know how to view kernel buffer/cache contents? I tried some terminal commands I found online, but none of them worked.
It seems unlikely to me that just connecting a drive fills up the memory, unless the metadata are cached from a huge amount of files. Anyhow, this memory can be considered as “almost free” because it can be reclaimed at any moment, so the impact should be not that big. Is there no indexer active collecting information of the files? If you go with CTRL-ALT-F3 to a terminal before login, are the drives mounted and cache filled? If not, it’s caused by the desktop environment. If you can SSH-login from a nearby system, may be “top” or “sudo iotop” reveal the process accessing the drives.
I just learned, so repeat it on your own risk, that (as root) “echo 3 >/proc/sys/vm/drop_caches” immediately empties the cache. Does it come back?
https://sysctl-explorer.net/vm/drop_caches/
Yes, memory can be reclaimed, but I wasn’t sure why the dynamics of filling up cache would change with just a drive change. I’m not worried about the cache being full at all.
No, the cache would fill up after I log into the DE, but much faster with SSD drives in SATA slots.
Anyway, something very suspicious was going on with SSDs in SATA slots…for example, after I removed one SSD and tried to enter BIOS setup it wouldn’t let me (entered BIOS password, so I know I was actually interfacing with BIOS, but would get a blinking cursors after a correct password entry)! I haven’t seen that ever before, so I know something was up.
Reinstalled BIOS, empty SATA slots, and things seem snappier. I don’t even want to troubleshoot further for now.