Bug 275907

Summary: Searching huge history increases the memory consumption every time, which makes konsole become slower and (possibly) crash.
Product: [Applications] konsole Reporter: Victor Varvaryuk <victor.varvariuc>
Component: historyAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal CC: adaptee, grzebyk, kdudka, simon, tcanabrava
Priority: NOR    
Version: 2.6.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Again
Again
memory used increases - as expected
After resetting scrollback - memory is not freed
Memory is not freed even after closing the tab

Description Victor Varvaryuk 2011-06-17 15:12:15 UTC
Version:           2.6.2 (using KDE 4.6.2) 
OS:                Linux

I have set unlimited scrollback option in the profile.
Currently konsole takes about 1GB of memory (in System Activity). When pres Ctrl+Shift+X and clear screen - memory consumption continues to grow.


Reproducible: Didn't try



Expected Results:  
Memory consumption to decrease after scrollback is cleared
Comment 1 Victor Varvaryuk 2011-06-17 15:23:56 UTC
Even after process stopped - memory consumption didn't decrease.
Even after tab close stopped - memory consumption didn't decrease.
Comment 2 Kurt Hindenburg 2011-06-18 16:13:54 UTC
If you look in /tmp/kde-<username>, you'll see the files Konsole uses for the scrollback.

How many tabs do you have open?  Is the 1GB under shared-memory?
Comment 3 Victor Varvaryuk 2011-06-19 07:37:40 UTC
i had 2 tabs open. One of them was idle.
1GB was not under Shared Mem.
If konsole uses files to store scrollback, then i don't understand memory increase.
Comment 4 Victor Varvaryuk 2011-06-23 14:04:09 UTC
Created attachment 61268 [details]
Again

Again konsole is eating memory but doesn't free it.
Comment 5 Victor Varvaryuk 2011-06-23 14:06:36 UTC
Created attachment 61270 [details]
Again

Again konsole is eating memory but doesn't free it.
Comment 6 Victor Varvaryuk 2011-06-23 14:08:32 UTC
Created attachment 61271 [details]
memory used increases - as expected

Sorry for previous duplicate entry - db errors.
Comment 7 Victor Varvaryuk 2011-06-23 14:09:45 UTC
Created attachment 61272 [details]
After resetting scrollback - memory is not freed

After pressing Ctrl+Shift+X - memory not freed
Comment 8 Victor Varvaryuk 2011-06-23 14:10:35 UTC
Created attachment 61273 [details]
Memory is not freed even after closing the tab

The memory is not freed even after closing the tab which was producing a lot of output.
Comment 9 Jekyll Wu 2011-08-04 17:11:10 UTC
I used 'for i in {1..500}; do dmesg; done' to generate enough history(taking 700M space under /tmp/kde-xxx/), and did not notice huge memory usage either when the tab is still open or already closed.

I'm using KDE-4.7.0
Comment 10 Jekyll Wu 2011-09-18 00:33:12 UTC
Well, I tried a few times again and failed to reproduce it. 

If you can still reproduce this problem, can you inform us the size of the history file under /tmp/kde-<username> when the huge memory consumption is observed? it should be named as konsolexxxxx.tmp .
Comment 11 Victor Varvaryuk 2011-09-19 09:20:57 UTC
Ok, i think i found it. The problem lies in Find. 
Do `for i in {1..500}; do dmesg; done`
Then press Ctrl+Shift+F and enter for example 'start' - and see how memory consumption grows. Then search for other words - 'stop', 'next', etc.
Comment 12 Jekyll Wu 2011-09-19 15:55:13 UTC
(In reply to comment #11)
> 

You are right. Now I can reproduce it every time. A minor difference is closing that tab will free the consumed memory.
Comment 13 Jekyll Wu 2011-09-19 15:55:42 UTC
*** Bug 209623 has been marked as a duplicate of this bug. ***
Comment 14 Jekyll Wu 2011-09-19 15:56:13 UTC
*** Bug 280282 has been marked as a duplicate of this bug. ***
Comment 15 tcanabrava 2019-06-25 08:36:03 UTC
Tested today, Seems fixed. Memory had spikes of 70m but went back to 35 just after a few seconds.