Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Programs run from program text, program text is mapped in as named pages (disk cache). They are evictable! And without swap, they will get evicted on high memory pressure. Program text thrashing is worse than having swap.

The problem is not the existence of swap, but that people are unaware that the disk cache is equally important for performance.



VM_EXEC pages are explicitly deprioritized from the reclaim by the kernel. Unlike any other pages, they are put into the active LRU on the first use and remain in the active LRU if they are active.


... until there are no deprioritized pages left to evict.


Pages from the active LRU are not evicted. Pages from the inactive LRU with the "accessed" bit set are also not evicted.


It's yet another old crap - to load program code from disk on-demand. Nowadays it's just easier to load the whole executable into memory and always preserve it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: