This is an old revision of the document!


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)

Active Queue

  • “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

Inactive Queue

  • Inactively (not recently used) used by userland
  • Not recently used (LRU)
  • Cannot be re-allocated to other processes

Cached

  • Almost “Free”
  • Backed by swap or files (ie mmap())
  • Available for re-allocation

Free

  • Literally Free.

Wired

  • Locked in-memory (by kernel, mlock, etc)
  • Cannot be swapped out
  • Kernel, kernel modules and kernel heap live here

Buffer

  • 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 :)

  • memory.1361367397.txt.gz
  • Last modified: 2013/02/20 13:36
  • by KubilayKocak