3 hours ago · Tech · 0 comments

note Linux memory accounting is full of metrics that look similar but measure very different things. This post is a short tour of the most useful ones and where they come from. How Linux Models Memory Linux gives every process a private virtual address space. Pages in that space may or may not be backed by physical RAM at any given moment - the kernel pages them in on demand and evicts them under pressure. Many pages are also shared between processes (libraries, the page cache, copy-on-write forks), so “how much memory does this process use?” does not have a single right answer. It depends on whether you count what is reserved, what is resident, what is private, and how shared pages are split across processes. On top of that, the kernel itself uses memory for the page cache, slab allocators, buffers, and reclaimable structures. “Free” memory is rarely the number you actually care about, because the kernel will happily use almost all RAM for cache and return it on demand. Per-Process…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.