logoalt Hacker News

basilikum • today at 5:40 PM • 1 reply • view on HN

> Memory reclaim reports how many pages it scanned and how many it managed to free per cgroup. Once roughly two megabytes' worth of pages have been scanned, the kernel turns that into a ratio. If it freed less than about 40% of what it walked, that counts as memory pressure, and every socket in the cgroup gets throttled for that one second. What's NOT in the formula is how much free memory the machine has.

Maybe I'm missing something, but can someone explain why memory pressure is detected like this in the first place? The article goes on to say that there was a TODO comment in the source to scale the scanning window proportional to the memory size, but why is memory pressure even measured like this without considering the free memory at all? Am I missing something or does that indeed make no sense?


Replies

majke • today at 5:49 PM

Afaiu memory pressure is a boolean. Either the cgroup is under pressure or not. What is the question?

➕ show 2 replies