Skip to content

Glossary

Pageout daemon (vm_pageout)

The kernel thread that walks the page queues, demotes inactive pages, and feeds the compressor / swap when free memory runs low.

The pageout daemon — a kernel thread running vm_pageout — is the engine of XNU's memory reclamation. It runs continuously, walking the active and inactive page queues, deciding what to reclaim under what conditions.

What it does:

  • Implements a two-handed clock algorithm to age pages: the active hand demotes recently-untouched pages from active to inactive; the inactive hand reclaims from inactive when free memory is low.
  • Hands inactive pages to the VM compressor for compression, or to the swap subsystem if the compressor is full.
  • Writes back dirty file-backed pages to their original files before reclaim.
  • Triggers jetsam when even compression and swap can't keep up.
apple-oss-distributions/xnuosfmk/vm/vm_pageout.cvm_pageout — the page-replacement daemon. Heart of memory management.View on GitHub(line )

The daemon's activity is observable: vm_stat 1 shows pageout counts per second; Activity Monitor's "Memory Pressure" gauge is a smoothed measure of how hard the daemon is working.

See also: VM compressor, working set, jetsam, and the memory pressure article.