Version: Konsole 1.2 (KDE 3.1-11 Red Hat) (using KDE KDE 3.1) Installed from: RedHat RPMs OS: Linux I used a Perl program from "Linux Server Hacks" to display the LoadAvg in my Konsole titlebar; result: a memory leak! I verified that the control codes used to print to an XTERM titlebar are correct, and I verified that Konsole *should* accept these XTERM codes, and I wrote a small demonstration CSH script (below). I'm wondering if this problem has not been noticed before, because---most commonly---a path (or something) is written to a titlebar upon a directory change. It would take quite a few directory changes to notice the memory leak! But, if you want to display the Load Average (or time) in the titlebar---and have it update every second or two---then the leak definitely becomes noticeable. I observed this memory leak over a *long* period of time before I figured-out the root cause. in fact, I even upgraded from RH8.0 to RH9, since the memory leak showed-up under the "kdeinit: kicker" process, I figured it was a Kicker bug. ------------------------------------------- #!/bin/csh # When I run this program on my system, I see the memory of the # "kicker" process jump up by 4kB every 17-19 seconds! I'm using the # "pmap" program to monitor the "kicker" memory increase. while (1) # The following is the REAL stuff I *wanted* in my titlebar: # #set loadavg = `cat /proc/loadavg | awk '{print $1," ",$2," ",$3}'` #set datetime = `date` #echo -n " ]2;$tty $loadavg $datetime" # # This is merely to demonstrate the memory leak that exists when # using XTERM control-character codes to print to the titlebar. # The memory leak shows-up in *kicker*! The process has the name # "kdeinit: kicker" on my machine. # # ]0 => write to titlebar text and icon text # ]1 => write to icon text # ]2 => write to titlebar text # # Write 40 characters (not counting control characters)... # echo -n " ]2;1234567890123456789012345678901234567890" # # ...every second: # sleep 1 end
Doh!! I forgot that the control codes wouldn't show-up. The one at the BEGINNING of the string is an Esc, which you get by typing: CTRL-V Esc (octal 033, decimal 27). The one at the END of the string is a Control-G, which you get by typing: CTRL-V CTRL-G (octal 007, decimal 7). Thanks, Bruce.
You say that the memory leak shows up in Kicker... How do you know that it's a Konsole bug and not a Kicker bug? For example, that behaviour would make sense if Kicker leaks memory every time a window's title bar changes, perhaps during updating the taskbar. If you run your script inside KDE but from a normal xterm, does Kicker still leak memory?
I really think this is a Kicker bug. I could not get your script to cause Kicker to leak memory when run from a generic xterm, but I think xterm is smart enough not to reset the title if it is the same string as the one you sent last time. I can get Kicker's memory to grow if I run this script from an xterm, which adds an element of randomness to the title string to work around xterm being smart: #!/bin/bash while true; do echo -ne "\033]2;${RANDOM}123456789012345678901234567890\007" done
Shoot! Thanks for the help. I'll go to my Linux box right now, and try it out for myself, but it certainly sounds like you are correct! Double-Doh! I can't believe that it did not occur to me that it really *could* be Kicker. Thanks again. If I get an XTerm to cause the same memory leak, then I will re- submit this as a Kicker bug. Bruce.
Yep. "awendt" was right! This is, in fact, a Kicker bug, *not* a Konsole bug. I'm sorry that I defamed the wonderful Konsole! ;-) Now, to move this baby to a *new* bug report under Kicker (after checking to make sure it's not already there somewhere!). Sorry for the noise, Bruce.