news.volyx.in

Finding and fixing Ghostty's largest memory leak (mitchellh.com)

632 points by thorel · 193 days ago · 138 comments on HN

Article summary

The Ghostty terminal emulator had a significant memory leak that was recently fixed. The leak was caused by a logic bug in the scrollback pruning optimization, which led to non-standard pages not being properly freed. The fix involves destroying non-standard pages during scrollback pruning and allocating a fresh standard-sized page from the pool. The fix is available in the latest nightly build and will be included in the 1.3 release in March.

Main themes

  • Memory leak fix
  • Terminal emulator development
  • Scrollback optimization
  • Bug tracking and reproduction
  • Software release cycles

What commenters say

  • The memory leak fix is a significant improvement, but some users are surprised it's not being released as a hotfix.
  • The bug was difficult to reproduce and required a reliable reproduction to be fixed.
  • Some users think the fix could be improved by reusing non-standard pages instead of destroying and recreating them.
  • The use of AI for visualizations is a reasonable and efficient approach for one-time use cases.
  • The decision to reserve the fix for a feature release instead of a bug fix release is questioned by some users.
  • The nightly releases are the expected way to get timely bugfixes, but some users may not be aware of this.
  • The impact of the bug was limited, but it was still important to fix to prevent potential issues.
  • The community's feedback and discussion were helpful in identifying and fixing the issue.