Basic concept for memory resource controller:
- Accounting physical memory usage under cgroup
- anon and file caches
- when memory limit is hit page in/page out memory
- Limit memory and swap usage under user specified value
- Memory stats per cgroups
- memory hungry applications can be isolated & limited to defined amount of memory
- OOM control
- moving (recharging) account at moving a task is selectable.
Brief summary of control files:
max_usage_in_bytes: show max memory usage recorded
total_pgpgin: Number of kilobytes the system has paged in from disk per second
total_pgpgout: Number of kilobytes the system has paged out to disk per second
total_pgfault: Number of major page faults (major + minor) made by the system per second
total_pgmajfault: Number of major page faults made by the system per second
total_inactive_anon: Number of bytes of anonymous and swap cache memory on inactive LRU list
total_active_anon: Number of bytes of anonymous and swap cache memory on active LRU list
total_inactive_file: Number of bytes of file-backed memory on inactive LRU list.
total_active_file: Number of bytes of file-backed memory on active LRU list
Note:
what is anon pages (Anonymous mapping:
anon is a memory mapping with no file or device backing it (like stack & heap)