[Konsole-devel] [Bug 176974] High memory consumption when using Konsole for a longer time.
Artem S. Tashkinov
t.artem at mailcity.com
Mon Jun 15 11:06:29 UTC 2009
https://bugs.kde.org/show_bug.cgi?id=176974
--- Comment #52 from Artem S. Tashkinov <t artem mailcity com> 2009-06-15 13:06:23 ---
I'm not a programmer at all, but here's my solution (probably a complete
rubbish :) ).
Say a user have N lines of history enabled. Most users run their console
maximized and have a known window width (shell variable $COLUMNS). Also most
applications/user activity doesn't fill up the history instantly so we can
safely allocate/mmap memory buffer = N*$COLUMNS*OVERHEAD/10 at a time. If a
user reaches N/10 lines of history we allocate yet another buffer of E size.
If a user decides to close a tab, then we can easily
munmap(E*N/10*allocated_buffers).
Of course, this approach doesn't take into consideration a possible resize
operation of a Konsole window or font size changes. But in this case we can
dynamically reallocate memory and change buffer size.
Another problem is that this approach doesn't take into consideration an
endless history. But in this case we can allocate buffers by 10K lines at a
time (or any other history lines number).
Just my $.02.
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the konsole-devel
mailing list