blog
Kernel panic data.kalloc.1024 on a Mac running many Claude Code sessions
A 32 GB Mac Studio running about 20 Claude Code sessions rebooted itself five times because the kernel zone data.kalloc.1024 leaked to about 20 GB. How to watch it with zprint, why the npm install leaks faster, and the three steps that stopped it.
- Published
- Updated on
Between 17 and 22 Oct 2026, my Mac rebooted itself five times, and every panic log said the kernel zone data.kalloc.1024 had run out. The cause is a kernel memory leak that Claude Code triggers, and the way Claude Code is installed decides how fast it leaks.
The machine and the setup: about 20 Claude Code sessions in parallel
Mac Studio M1 Max, 32 GB RAM. It ran macOS 26.5.2 when the panics happened; it runs 26.7.1 now.
Each project has its own Claude Code session in tmux, opened automatically when the machine boots. I drive them remotely through Remote Control (the Claude app on my phone and on other machines), so the Mac runs all the time with nobody sitting at it. The sessions use MCP servers, including Playwright and Chrome DevTools, which run headless Chrome, and they run e2e tests with Playwright.
The symptom: zone map exhausted in data.kalloc.1024
The machine reboots on its own. The panic log says:
zone map exhausted while allocating from zone [data.kalloc.1024]
The process named at the moment of the crash was claude.exe every time.
Watching the zone with zprint
zprint data.kalloc.1024
Column 7 is the number of elements in use, 1 KiB each. The zone grows while Claude Code runs and the machine panics when it reaches about 20 GB. Quitting Claude only stops the growth. Only a reboot gives the memory back.
The cause: issue #66020 has no fix, and the npm install leaks faster
The bug is reported at anthropics/claude-code#66020, and as of 31 Oct 2026 the issue is still open. The common suspicion is that the bug lives in the macOS kernel and Claude Code is what triggers it.
On my machine, more Claude Code processes meant a faster leak, and that includes short claude commands run from scripts.
The npm install updates itself, which means it replaces the executable underneath sessions that are still open. One panic came 4 minutes after such an update. While sessions kept running on the npm files that had been removed, the zone leaked 80 to 150 thousand elements per minute, which came to 3.3 GB in 40 minutes.
The fix: native installer, weekly updates, a watchdog script
- Move Claude Code from npm to the native installer. There is a trap:
claude installrun from the npm build also removes the npm package, even while sessions are running from it, and an old session that is still running will reinstall the npm package. So restart every session right after the switch, then check withnpm ls -g @anthropic-ai/claude-codeand remove the package once no process uses it. - Turn off auto-update in the background sessions with
DISABLE_AUTOUPDATER=1. Updates go into one weekly job:claude update, then restart every session if any of them still runs the old version. The job first ran every night, but Claude Code ships a release almost every day, so every morning the sessions had lost their scheduled tasks, and I moved it to weekly. - A watchdog script on a schedule: it reads
zprint, computes the growth rate, and warns at 12 GB and 16 GB so I can reboot on my own terms before a panic.
After the move to native, the zone stayed flat: a rate of 0 for 8 hours with 17 sessions running. Since 22 Oct there has been no panic of this kind.
Limits of this fix
- Neither Claude Code nor macOS has shipped a fix. The native installer and the watchdog script are a way to live with the bug.
- A leak inside the kernel is not freed by quitting the app, only by a reboot. An early warning so you can reboot yourself beats waiting for the panic.
- A different panic string means a different problem. On 31 Oct the machine panicked again with
100% of compressed pages limitwhile the kalloc watchdog still reported 0.0 GB. That case and its fix are in the post A Mac with 65% RAM free nearly panicked.
Related posts
all posts →- A Mac with 65% RAM free nearly panicked: the compressor, IOSurface and Playwright's WebKitA 32 GB Mac Studio panicked with 100% of compressed pages limit, then came close to a second panic that evening while RAM still showed 65% free. The page count in the compressor had filled up, and the culprit was IOSurface that Playwright WebKit left in the kernel.read more →
- REA: letting an agent reverse engineer software, then testing the oracle tooREA lets a coding agent read a program that has no source, down to machine code, then rebuild that feature in its own code. Whether the rebuild is right is up to the oracle, and the oracle is code too, with its own bugs.read more →
- Top 10 Claude Code skills by GitHub stars: what each one does and which ones overlapThe ten Claude Code skill sets with the most GitHub stars on 29 Oct 2026: Superpowers, Matt Pocock Skills, Karpathy Skills, Anthropic Skills, Ponytail, UI UX Pro Max, Graphify, Caveman, Agent Skills, Taste Skill. Each one with its install command, what it does and where it overlaps with another set.read more →
- Claude Code + NotebookLM + Obsidian: a research pipeline, and the half of the bridge that is unofficialHow to combine Claude Code, NotebookLM and Obsidian into a research pipeline: which skills already exist, why NotebookLM has no API for personal accounts, and the price of wiring these three tools together.read more →