konqueror preloading issue

Lubos Lunak l.lunak at suse.cz
Tue Jun 29 15:54:40 BST 2004


On Monday 28 of June 2004 15:49, Dario Massarin wrote:
> On Tuesday 29 June 2004 07:45, Lubos Lunak wrote:
> >  Please provide the state of all MALLINFO flags in kdebase/config.h and
> > KDE_MALLOC in kdelibs/config.h, values of all struct mallinfo fields (for
> > both startup and when keeping for preloading), and all the Vm* fields
> > from /proc/<pid>/status.
>
> mallinfo fields (at application startup):
> konqueror: mallinfo:  hblkhd=0 uordblks=3274544
>
> mallinfo fields (before calling setPreloadedWindow() ):
> konqueror: mallinfo:  hblkhd=0 uordblks=6887768

 I asked for all fields here.

>
> /proc/<pid>/status (at application startup):
>
> Name:	konqueror
> VmSize:	   31880 kB
> VmLck:	       0 kB
> VmRSS:	   19312 kB
> VmData:	    4420 kB
> VmStk:	      68 kB
> VmExe:	       4 kB
> VmLib:	   22220 kB
>
> /proc/<pid>/status (before closing konqueror):
>
> Name:	konqueror
> VmSize:	   52200 kB
> VmLck:	       0 kB
> VmRSS:	   38456 kB
> VmData:	   17428 kB
> VmStk:	      68 kB
> VmExe:	       4 kB
> VmLib:	   27764 kB

 The total difference is 20MiB, and part of it is from more loaded plugins 
(KParts); at least the VmLib difference, but also a part from VmData due to 
dirty pages caused by relocations and so on. It's also possible part of the 
newly used memory is reported in some mallinfo field which is ignored in 
konqy, or it's simply unreleased memory from malloc() due to fragmentation or 
whatever.

 The problem with this is that I'm not aware of any reasonably portable way to 
find out _real_ memory usage of the application. mallinfo() is just for 
dynamic allocation, getrusage() apparently doesn't give any useful info on 
Linux, and I don't know anything else.

 If this bothers you so much, you can try writing platform-specific code like 
checking the VmSize[*] difference on Linux, and preferring that check to 
using mallinfo(). You'd need to increase the limit of course, 16MiB for 
VmSize is nothing compared to mallinfo() - the point of this hack is to get 
faster Konqueror startup at the expense of some memory, not to have a coding 
exercise that doesn't do anything in practice.

 You might also check that the tabs are really closed, although I'd say that 
viewManager()->clear() does that (I don't know Konqy internals that much 
though).

[*] - Hmm, now that I checked it here, just going to dot.kde.org bumps up 
memory usage by 100MiB, according to /proc/<pid>/status or statm , but 
there's no serious memory usage increase in general according to 'top'. 
Memory usage on Linux is a black magic :(.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/




More information about the kfm-devel mailing list