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,
memorystatusmonitors 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:
sysmondcollects raw values exposed by the kernel viasysctland Mach subsystem interfaces. - Service Consumption: Applications like Activity
Monitor and internal diagnostic systems retrieve real-time data directly
from
sysmondto 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
memorypressurein 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 warnorcritical) 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:
- Normal (Green): Free memory and compressed memory are at balanced levels; disk swap is minimal or idle.
- Warning (Yellow): The kernel increases compression activity and prompts background tasks to drop temporary caches.
- 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.