Wezterm getting memory allocation failure if configured with large scrollback_lines buffer
What Operating System(s) are you seeing this problem on?
macOS
Which Wayland compositor or X11 Window manager(s) are you using?
No response
WezTerm version
20240203-110809-5046fc22
I have tested with latest nightly build too. Noticing the same behaviour too.
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
I have a config in my wezterm.lua
config.scrollback_lines = 100000000000
It seems like wezterm allocates the total memory of the configured number of lines as soon as the new tab is opened. Ideally it should do incremental memory allocation. Thus after opening certain number of tables, wezterm gets oom-killed.
❯ wezterm
memory allocation of 13600000008568 bytes failed
To Reproduce
Add the config to wezterm.lua
config.scrollback_lines = 100000000000
And open tabs. It should get oom-killed.
Configuration
config.scrollback_lines = 100000000000
Expected Behavior
Wezterm shouldn't preallocate the memory required for all the scrollback_lines ahead of time with the expectation that all will be used. It shouldn't get oom-killed in such scenarios.
Logs
❯ wezterm memory allocation of 13600000008568 bytes failed
Anything else?
No response