Finding and Fixing Ghostty’s Largest Memory Leak
Mitchell HashimotoFinding and Fixing Ghostty’s Largest Memory LeakJanuary 10, 2026A few months ago, users started reporting that Ghostty was consuming absurd amounts of memory, with one user reporting 37 GB after 10 days of uptime. Today, I’m happy to say the fix has been found and merged. This post is an overview of what caused the leak, a look at some of Ghostty’s internals, and some brief descriptions of how we tracked it down.1 The leak was present since at least Ghostty 1.0, but it is only recently that popular CLI applications (particularly Claude Code) started producing the correct conditions to trigger it at scale. The limited conditions that triggered the leak are what made it particularly tricky to diagnose. The fix is merged and is available in tip/nightly releases, and will be…