-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running notcurses-demo consumes a lot of memory. #885
Comments
This may be just merged into #254, but I’ll take a Quick Look to see if there is anything obvious/egregious standing out i.e. if this is a leak or if this is just a situation where we aren’t resizing back down from a large scrollback or something. Importantly, this appears to be on Linux, so things like Kitty image protocol are immediately out of the question (since it’s disabled currently on Linux due to the render work not being done). That narrows it down a bit because Ghostty really doesn’t do that much allocation beyond the screen state. |
I ran this through macOS leak detector (via Instruments.app) and there is no purposeful leak it can find. One thing I did notice is that memory balloons when we're going through glyphs and I think that's because we never shrink the codepoint cache. So that's an easy win. Another I noticed is that memory really skyrocketed during the "yields" demo but for that one I have no idea why yet. |
I no longer believe this to be true. I removed the cache entirely and don't see a noticeable memory difference. I also did some math and realized that even with 1,000,000 cached code points and glyphs it uses less than 30MB of RAM so this isn't it. |
Fixes #885 Interestingly, this isn't that big of a leak for whatever reason on macOS. But on Linux with fontconfig this is a MASSIVE memory leak.
Okay! I found a massive memory leak with fontconfig and fallback fonts on Linux. I don't think in a realistic environment this would cause many problems but nocturnes creates a pretty large set of font discovery queries so it's really apparent. After this, my memory usage is stable after a certain point for demo runs. |
The text was updated successfully, but these errors were encountered: