You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Evaluate circular_buffer_space_optimized for the console scrollback and other circular buffers #19738
boost::circular_buffer allocates its whole capacity up front. #19691 moved the console history (ConsoleHistory) to boost::circular_buffer_space_optimized, which treats the capacity as a maximum and allocates as elements are added, after R_HISTSIZE=999999999 tried to allocate gigabytes at startup. This issue is to evaluate whether the backend's other circular_buffers could or should switch too.
the console_max_lines pref: default 10,000, minimum 10, no maximum
The likeliest candidate. The capacity is user-set, and all of it is allocated when the pref is applied: 32-40 bytes per slot, so 10 million lines would take 320-400 MB up front. Resized with rset_capacity() under a mutex.
Usually full in an active terminal, so there's little to save, and growing it would add reallocations.
Things to weigh for ConsoleActions:
Whether a very large console_max_lines happens in practice, or whether a maximum on the pref would be the simpler fix.
The space-optimized buffer moves its elements each time it grows (doubling), and shrinks once its size drops to a third of what's allocated.
Separately, src/cpp/session/modules/SessionLists.cpp and src/cpp/session/include/session/SessionConsoleProcess.hpp include <boost/circular_buffer.hpp> without using it; those includes can go.
Activity
trim blank lines in trimLeadingLines(); don't re-push flushed console…
don't report a trim when trimLeadingLines() removes nothing
check the console output line limit for overflow at compile time
keep the console scrollback working when its storage can't grow
report the scrollback limit as set; don't lower it to 0
stop the growth-failure test before reading an empty buffer
allocate the console scrollback as output arrives (#19750)