[BUG] macOS 26.5.1 kernel zone leak (data.kalloc.1024) from Claude Code CLI — claude.exe panics at ~20GB, leak rate scales 21→1027/sec with agent load

Open 💬 14 comments Opened Jun 7, 2026 by LeifErikH

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code CLI triggers an unbounded kernel memory leak in macOS zone data.kalloc.1024. The leak is in kernel space, not Claude's userspace RSS. Zone count climbs from ~1,200 after reboot to ~21M elements (~20 GB), then the machine kernel panics.

Leak rate scales with agent load (measured with sudo zprint):

  • ~21 elements/sec idle
  • ~103/sec moderate use
  • ~1,027/sec under heavy parallel agent work (shell tools, git, file I/O)

At burst rate, time to panic is on the order of hours, not days. Four kernel panics in eight days (May 31 – Jun 6 2026), all with the same signature.

This is not the MCP process fan-out pattern (#64366 / #45880): only 1 MCP server configured (obsidian). Panicked task is always claude.exe, not hundreds of node MCP children.

Same mechanism as #44824 (closed duplicate, Apr 2026) — still reproducing on macOS 26.5.1 with quantified leak rates.

What Should Happen?

Claude Code sessions (including concurrent CLI sessions under load) should not cause unbounded kernel kalloc.1024 growth or macOS kernel panics. Kernel zone usage should stay bounded; terminating Claude should stop further kernel leak growth (as reported in #44824 when the process is killed).

Error Messages/Logs

panic(cpu 6 caller 0xfffffe00392ab31c): zalloc[3]: zone map exhausted while allocating from zone [data.kalloc.1024], likely due to memory leak in zone [data.kalloc.1024] (20G, 21286288 elements allocated) @zalloc.c:4575

Panicked task: pid 14507: claude.exe

Kernel Extensions in backtrace:
  com.apple.iokit.EndpointSecurity (1.0)
  com.apple.filesystems.apfs (2811.120.14)

Live monitoring (same session, heavy load):

now=06:18:37  zone=3364417  (~3.21 GB of the 20 GB ceiling)
rate=1027/sec over 30s (delta 30834)
at this rate, time to 21M ceiling: ~4h (285min)
started this session at ~1,200; now 3364417

Steps to Reproduce

  1. Environment: macOS 26.5.1 (25F80), Mac17,2, 32 GB RAM, Claude Code 2.1.168, Terminal.app, 1 MCP server (obsidian).
  1. Reboot Mac (clean zone: data.kalloc.1024 ~1,200 elements).
  1. Start 3–4 concurrent claude CLI sessions on a large monorepo (active agent work: Bash, git, ripgrep, file reads/writes).
  1. In another terminal (optional), monitor zone every 30–60s:

zprint 2>/dev/null | awk '$1=="data.kalloc.1024"{printf "%s zone=%s (~%.2f GB)\n", strftime("%H:%M:%S"), $7, $7*1024/1073741824}'

  1. Observe monotonic zone growth; rate increases sharply under parallel agent + shell activity.
  1. Expected failure: kernel panic when zone approaches ~21M elements (~20 GB), typically within hours under heavy load.

Control: Kill all claude processes — growth should stop (per #44824). Reboot resets zone to ~1,200.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.168 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Hardware: Mac17,2, 32 GB RAM

Configured MCP servers: 1 (obsidian only) — rules out N×M MCP fan-out (#64366, #45880) as primary cause here.

Related issues:

  • #44824 — same kalloc.1024 / claude.exe panic, closed duplicate, unresolved from reporter POV
  • #64366, #45880 — MCP multiplication; different mechanism on this setup

Apple side: Kernel zone leak in data.kalloc.1024 with EndpointSecurity + APFS in backtrace; panic logs submitted / to be submitted via Feedback Assistant (UUID e.g. 67756C3A-BD42-4268-ABB8-E7A0DDA4F992).

Workarounds tried: Spotlight Privacy on ~/.claude, ~/.grok, ~/.codex, worktrees; pruning ~44 GB agent worktrees — reduces indexing pressure but does not stop active kalloc.1024 growth under load.

Request: Reopen or link tracking for #44824; investigate Claude Code's macOS file/sandbox/EndpointSecurity path on macOS 26; workarounds beyond "reduce concurrent sessions" (not viable for production deadlines).

View original on GitHub ↗

This issue has 14 comments on GitHub. Read the full discussion on GitHub ↗