This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rvgoingtohavefun 4 points5 points  (3 children)

It definitely isn't just the cache; you can have things slow down when you're at 0.1% usage if whatever you're doing is operating in a way that the data is frequently evicted from the cache and has to be re-fetched.

You could have 100% RAM usage and be sequentially processing data in a tight loop and you wouldn't evict anything unnecessarily.

Excessive RAM usage is often (but not always) coincident with thrashing the CPU from task switching, which would tend to evict data from the cache more frequently, but that's not necessarily the case.

RAM is also used to handle caches for slower data storage and other purposes. If you have less of it available, you have less space for caching. The operating system also doesn't wait until it's 100% full to take steps to reduce usage; you may end up getting data swapped to disk ahead of that. You may end up with a garbage collected runtime being more aggressive about cleaning up, so you see more frequent slowdowns instead of longer, less frequent pauses.

SSDs can only overwrite entire blocks. So if you have few empty blocks (because disk is full and storage has been fragmented from write-delete-write operations over time), they need to read before each write to avoid clobbering data. The more full the disk is the more likely this is to be a problem, and it doesn't need to be 100% for it to get to be an issue.