In this article
Choose an accounting scope and distinguish shared RSS, proportional attribution and private growth in mapped model memory.
Several model workers map the same weight files and each reports a large RSS. Adding those RSS values can count shared resident pages repeatedly. Use per-mapping evidence and proportional accounting to describe host consumption without assuming that every process owns a private physical copy of every mapped weight.
Define the accounting question
Decide whether the question is one process’s resident footprint, proportional attribution across processes or enforcement within a memory cgroup. These are different views. State the population and observation time before collecting totals. A process sum and a cgroup charge can differ without either interface being broken, because their scopes and treatment of shared pages are not identical.
Read mapping categories
smaps separates virtual Size, Rss, Pss and shared or private clean and dirty categories for mappings. Preserve the backing identity and permissions alongside these values. A large Size need not be fully resident. A private mapping declaration also does not mean every page already has a private physical copy; copy-on-write changes can alter that relationship over time.
Use proportional values deliberately
Pss apportions shared resident pages rather than charging each observer the entire shared page. It helps explain why summed RSS overstates a particular process population’s unique ownership. However, the population can change during measurement. Do not subtract unrelated snapshots or treat proportional attribution as an immutable billing rule, a reserved allowance or a prediction of the next allocation’s success.
Inspect newly private growth
Compare the same workload phase before and after conversion, mutation or a worker update. File-backed clean pages and private dirty or anonymous growth can tell different stories. Preserve the relevant mapping ranges rather than labeling the whole delta as duplicated weights. Framework staging and runtime metadata may create separate allocations that do not share the source file’s identity.
Verify with a small shared mapping
Use harmless files and a controlled process population to observe shared reads, then a scoped private write where permitted by the mapping contract. Compare category changes and the chosen total. Acceptance means the report describes its accounting scope honestly. It does not measure GPU residency, prove that all workers share identical tensors or guarantee memory availability under future host pressure.
Primary references
Related reading: OS page cache and cold model loading: what to record; Container stalls without OOM: reading memory.high and memory.events.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.