Hacker News new | ask | show | jobs
by xxs 828 days ago
none of my laptops/desktop/gaming rigs or servers feature swap. Swapping along with a managed language and garbage collection is next to indistinguishable from a application crash.
1 comments

Is it? What about the page cache impacted by those applications’ file I/O?
it is, trying running stop-the-world type of a garbage collection along with page-in-out, etc.

>cache impacted by those applications’ file I/O

Which cache? The disk one, that depends on the available memory, with pretty much all free memory being a disk cache. In the cases of swapping, there is no disk cache left, effectively.

That is not how paging works. The swap area is also a cache in every sense of the word. And the kernel will swap out pages that clearly are accessed less frequently than another page, even if that page is the buffer cache. When used like that, swapping is a way of getting more disk cache.

Generally speaking, systems do not swap out pages only under memory pressure. That design would be ineffective. When memory pressure is high enough, you've already lost.