[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: What happened to KStaticDeleter
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2007-10-02 23:10:10
Message-ID: fduj4j$r9b$1 () sea ! gmane ! org
[Download RAW message or body]

Andras Mantia wrote:
> Ok, I have to ask it to make it clear for myself. :) Does it mean that 
> KParts are not unloaded after the application deletes them?
> For example in Konqueror if you open 10 tabs and remove 9, the (data) 
> memory usage will not decrease? Or the same in Quanta/KDevelop when 
> loading many documents (Katepart objects) and closing them.
> Actually with top this is how it looks like:
> 
> VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 
> 217m  45m  26m S  0.2  4.6   0:02.70 quanta - 1 katepart
> 226m  53m  26m S  0.0  5.3   0:04.39 quanta - 10 katepart
> 226m  53m  26m S  0.0  5.3   0:05.41 quanta - 1 katepart (9 closed from 
> the above 10)
> 
> It's true that loading again 10 kateparts doesn't add 8m to RES, it 
> remains on 53m level, but still, this doesn't look good. 

Sigh. Memory stats aren't worth much except to find peak usages... even 
RES. The heap usually doesn't return memory to the kernel (not much 
reason, generally), and the kernel likely does not swap out 
not-recently-touched pages until page faults occur. free()/delete does 
not make memory usage go down as such; mostly, it just makes more heap 
available for future use.

A more interesting test would be, open ten tabs, close nine, do 
something else for an hour, go back to the app, use it for a while with 
only one tab open, and *then* look at the RES. This way you've 
encouraged the kernel to swap out whatever pages aren't actually in use 
and to only swap back in ones that are still being used. Even then, 
memory fragmentation may keep this number higher than before you opened 
nine more tabs.

Of course, systemic growth (indicative of a leak) would be a real bug.

-- 
Matthew
There's no place like ~.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic