[Konsole-devel] [Bug 176974] High memory consumption when using Konsole for a longer time.

Matthew Woehlke mw_triad at users.sourceforge.net
Mon Jun 8 16:55:27 UTC 2009


https://bugs.kde.org/show_bug.cgi?id=176974





--- Comment #29 from Matthew Woehlke <mw_triad users sourceforge net>  2009-06-08 18:55:12 ---
I've been away or I would have joined the conversation sooner. The current
method stores each character as a 11-byte struct? (Comment #20 makes me think
yes.) Also, I think konsole is optimizing the paint anyway, to combine chars
with same format?

A possibility that occurs to me is to store each line as a packed array with
run count and one or more runs, where a "run" looks like:
2: total bytes in run (for easy skipping to next run)
1: attributes present
1: format/flags (optional, if specified in 'attributes present')
4: foreground color (optional, if specified in 'attributes present')
4: background color (optional, if specified in 'attributes present')
2*k: char (k >= 1, a wchar_t*, NUL omitted if possible)

This would minimize the space used to that needed to record the content (no
overhead from storing text and formatting separately) and still allows the
characters of a run to be passed directly to the paint function. The overhead
for a line with no formatting (usual case) goes from 9*k bytes to 10 bytes.

Of course, one advantage to separating text and formatting is that copying text
is easier.

-- 
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