logoalt Hacker News

delamon • today at 5:49 AM • 1 reply • view on HN

All recently referenced code pages in the active LRU are excluded from reclaim.

Code pages are paged in on demand: for any sufficiently large binary just some code pages will be mapped right after start. Given enough memory pressure, the active LRU will be shrunk often enough to push code pages out of the active LRU and then they are eventually evicted.

I'm not aware how it works in modern MGLRU, but I would assume similar ovservable behevior holds.


Replies

man8alexd • today at 8:58 AM

Active code pages with the "Accessed" bit set are specifically excluded from being moved to inactive LRU when active LRU is being shrunk. Instead, they are moved to the head of the active LRU. All other pages are moved from active LRU to the inactive LRU unconditionally, even if they have the "Accessed" bit set. So, no, the active code pages are not going to be eventually evicted.

➕ show 1 reply