macOS 13 Memory Pressure Metrics Process

In macOS 13 (Ventura), system memory pressure metrics are tracked, evaluated, and managed primarily by the operating system's XNU kernel subsystem known as memorystatus, working in tandem with the sysmond (System Monitor) background daemon. While the kernel continuously measures physical memory availability, pageouts, and compression ratios to assign system-wide pressure states, user-space utilities and APIs query these metrics to report system health. This guide details the specific processes responsible for tracking memory pressure in macOS 13 and how the operating system handles those metrics.

The Kernel Engine: memorystatus

The foundational process monitoring memory pressure is not an isolated user-space application, but an active subsystem within the macOS XNU kernel called memorystatus.

  • Continuous Tracking: The kernel tracks available RAM against fixed thresholds (Normal, Warning, and Critical).
  • Memory Compressor Integration: Rather than relying exclusively on disk swapping, memorystatus monitors how aggressively the VM compressor is operating to free up pages.
  • Notification Broadcasting: When available memory dips below predefined levels, the kernel sends asynchronous dispatch events (DISPATCH_SOURCE_TYPE_MEMORYPRESSURE) to registered applications, prompting them to purge non-essential caches.

The System Daemon: sysmond

In user space, macOS 13 utilizes the sysmond (System Monitor Daemon) to aggregate, check, and log system performance metrics, including CPU usage and memory pressure statistics.

  • Metric Aggregation: sysmond collects raw values exposed by the kernel via sysctl and Mach subsystem interfaces.
  • Service Consumption: Applications like Activity Monitor and internal diagnostic systems retrieve real-time data directly from sysmond to display the "Memory Pressure" graph.

User Diagnostics: The memorypressure Utility

For administrators and developers needing to inspect or test memory states on macOS 13, Apple includes a built-in command-line tool named memorypressure.

  • Checking Current Status: Running memorypressure in the Terminal prints real-time statistics regarding system pressure levels, page-free counts, and compressor activity.
  • Simulating Pressure: The tool can be executed with specific flags (e.g., sudo memorypressure -l warn or critical) to force the operating system into elevated pressure states to observe how running tasks behave.

How Memory Pressure is Categorized

macOS 13 avoids measuring memory performance solely by the quantity of free RAM, as unused RAM is treated as wasted performance. Instead, memorystatus categorizes memory health using three tiers:

  1. Normal (Green): Free memory and compressed memory are at balanced levels; disk swap is minimal or idle.
  2. Warning (Yellow): The kernel increases compression activity and prompts background tasks to drop temporary caches.
  3. Critical (Red): Memory compression is maxed out, swapping to disk increases, and the system may terminate lower-priority background processes (jetsam) to prevent complete system unresponsiveness.