Bug 142251 - Extreme memory usage after clearing histories
Summary: Extreme memory usage after clearing histories
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6.6
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-27 02:01 UTC by Mike Culbertson
Modified: 2008-01-16 02:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Culbertson 2007-02-27 02:01:03 UTC
Version:           1.6.6 (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
Compiler:          gcc version 4.1.1 (Gentoo 4.1.1-r3) 
OS:                Linux

It seems the memory used for history is not freed when histories are cleared, and in fact more than doubles usage when cleared.

This is not quick to reproduce, but I have seen it several times.

-Running 2 Konsole windows with ~21 shell tabs total. 100k lines of history per shell (yes I need that much). Some histories are full, most probably are not.  Shells have been running for at least 2 weeks.
-Memory Usage at roughly 280MB
-I "Clear all Histories" on both windows, which freezes the system for ~10 seconds per window.
-Memory usage for konsole has now ballooned to ~670MB. This does not reduce until I close out all my sessions.

mculbert@radium ~ $ ps -eo rss,args | grep konsole
672636 konsole [kdeinit] -session 10e7ce6469000115361676900000137650009_1170358463_821607
mculbert@radium ~ $

From top:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 8881 mculbert  15   0  674m 656m  12m S    1 32.4  10:19.71 konsole


TIA

-Mike Culbertson
Comment 1 Robert Knight 2007-02-27 04:03:53 UTC
> 100k lines of history per shell (yes I need that much). 

I would suggest using the "Unlimited" history mode in that case, it uses a file instead of storing everything in memory. 

> It seems the memory used for history is not freed when histories 
> are cleared, and in fact more than doubles usage when cleared.

I wasn't able to detect anything amiss with Valgrind. ( valgrind --leak-check=full konsole ) 

The memory usage does appear to increase when the "Clear All Histories" is invoked for the first time, but subsequent fill-history -> clear-history -> fill-history cycles don't increase the usage any more. 

If you do repeated fill-history -> clear-history -> fill-history cycles, does the memory usage continue to increase significantly?  
Comment 2 Robert Knight 2008-01-16 02:14:46 UTC
I am unable to reproduce here and there haven't been any additional responses from the reporter.  Closing for now.