Ghostty's creator details a memory leak that caused the terminal emulator to consume up to 37 GB of memory after extended use. The bug stemmed from a scrollback optimization that reused pages but incorrectly reset metadata to standard size while leaving large mmap allocations intact, preventing munmap from being called. The
Table of contents
The PageListThe Scrollback OptimizationThe BugThe FixFinding the Leak with VM TagsThanksFootnotes4 Comments
Sort: