mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-06 16:29:04 +00:00
The guard credited only inactive_file as reclaimable. On a kernel with the multi-generational LRU a page faulted in through a mapping lands on the active list at once, so the same engine in the same container saw 26.7 GiB available after a restart with its n-gram table still cached and 57.1 GiB after a cold start. The kernel reclaims clean active file pages at the limit as it does inactive ones (checked in a 24 GiB scope without swap: 21.45 GiB of anonymous memory allocated over 11 GiB of active cache, no OOM kill). The old comment said active_file holds mlocked pages; the kernel puts mlocked pages on the unevictable list and shmem on the anon lists, so neither is on the file lists. Under a cgroup limit below MemTotal (a container: /proc/meminfo is the host's) the credit is now active_file + inactive_file less dirty and writeback. With no limit, a limit at or above MemTotal, or the operator's --memory-limit-mib cap, the credit stays inactive_file only, unchanged. STRATA_MEM_CREDIT_INACTIVE=1 keeps the inactive-only credit everywhere. The memory.stat parsing is a pure function now, with unit tests.