32 ms·
I think the point is that, the more free RAM you have, the more data the OS can speculatively read from disk when there's otherwise unutilized bandwidth. If a p
by sgtnoodle 5y ago
I think the point is that, the more free RAM you have, the more data the OS can speculatively read from disk when there's otherwise unutilized bandwidth. If a program happens to need the data, then it's already in RAM and the access latency is almost zero, vs. the non-zero latency of waiting for a hard disk platter to spin around.
The claim being made is that there are certain situations where processes allocate a lot of physical memory but then very rarely accesses it. If it gets paged out to swap, then there's a latency hit on the next access. If the OS can avoid more latency hits total using the same physical RAM for caching, then the computer could do more overall calculations per second.
- Sirened 5y agoYep! The idea of "free memory" largely doesn't exist in modern operating systems. We haven't gotten to the point of power gating DRAMs (have we?), so we're always paying the cost of the DRAM all the time. As such, not using it means you're just throwing energy away. Keeping lots of purgeable data in these unallocated space like (as you said) disk cache not only speeds up access time but also saves a ton of power since a hit to DRAM is leagues lower than having to access external storage. While this is a non-trivial engineering problem, it's almost always a good trade off since it boost performance and saves power without any extra cost other than the effort of speculative loads (which, when linear, is much less expensive than a random one off load!) and managing it