A plain language description of the memory stats seen in places like top(8) and sysctl output, designed specifically for a non-developer audience.
Userland memory is generally either Anonymous (swap-backed) or (file-backed)
- "Actively" (Recently) used by userland
- Moved to Inactive when act(ivity)_count=0 (by pagedaemon)
- act_count is updated by hardware page access bits
- "Second Chance" replacement algorithm
- Inactively (not recently used) used by userland
- Not recently used (LRU)
- Cannot be re-allocated to other processes
- Almost "Free"
- Backed by swap or files (ie mmap())
- Available for re-allocation
- Literally Free.
- Locked in-memory (by kernel, mlock, etc)
- Cannot be swapped out
- Kernel, kernel modules and kernel heap live here
- Accounts for Disk IO cache entries for non ZFS filesystems
- Actual data may be stored in Active, Inactive or Wired
- Only usable by the kernel
Special thanks to avg and zont for putting up with my probing questions for over an hour to squeeze this valuable information out