konqy preloading kills performance

Dario Massarin nekkar at libero.it
Wed Dec 15 20:07:16 GMT 2004


On Wednesday 15 December 2004 12:25, Lubos Lunak wrote:
>  Hmm :(. Could you please have a closer look at current_memory_usage() in
> konqueror/konq_mainwindow.cc and check what exactly it does when it reports
> this low value? Also, the Linux memory check uses /proc/<pid>/statm, not
> status, so contents of that could be useful as well.

It seems that konqueror the current_memory_usage() function returns exactly 
what it should:

#konqueror </dev/null 2>&1 | tee logfile2.txt

#cat logfile2.txt | grep Memory
konqueror: Memory usage increase: 7271424 (15493120/8221696)

#cat logfile2.txt | grep preload
konqueror: Konqy kept for preloading :konqueror-6740

#cat /proc/6740/statm
14944 10860 8550 2 0 14942 0

Here the first number is only a bit different from the one that konqueror 
reads when the current_memory_usage() functions gets called. I think this is 
normal becouse I execute the above command in a different time.
Maybe the problem resides on the fact that using this data to know the current 
memory usage is not completely correct.
Reading   /usr/src/linux/Documentation/filesystems/proc.txt  I found a little 
(and too little for my taste) explanation of the output of statm:

Table 1-2: Contents of the statm files 
..............................................................................
 File			Content                         
 size        		total program size              
 resident		size of memory portions         
 shared		number of pages that are shared 
 trs			number of pages that are 'code' 
 drs			number of pages of data/stack   
 lrs			number of pages of library      
 dt			number of dirty pages           


#pmap 6740
konqueror(6740)
08048000 (4 KB)        r-xp (03:03 1447968)  /usr/kde/3.2/bin/konqueror
08049000 (4 KB)        rw-p (03:03 1447968)  /usr/kde/3.2/bin/konqueror
0804a000 (23344 KB)    rwxp (00:00 0)
40000000 (80 KB)       r-xp (03:03 970583)   /lib/ld-2.3.3.so
40014000 (4 KB)        rw-p (03:03 970583)   /lib/ld-2.3.3.so
40015000 (4 KB)        rw-p (00:00 0)
40016000 (708 KB)      r-xp (03:03 
1929655)  /usr/kde/3.2/lib/libkdeinit_konqueror.so
400c7000 (32 KB)       rw-p (03:03 
1929655)  /usr/kde/3.2/lib/libkdeinit_konqueror.so
400db000 (1192 KB)     r-xp (03:03 970440)   /lib/libc-2.3.3.so
40205000 (12 KB)       rw-p (03:03 970440)   /lib/libc-2.3.3.so
40208000 (12 KB)       rw-p (00:00 0)
4020b000 (500 KB)      r-xp (03:03 1748742)  /usr/kde/3.2/lib/libkonq.so.4.2.0
40288000 (20 KB)       rw-p (03:03 1748742)  /usr/kde/3.2/lib/libkonq.so.4.2.0
4028d000 (244 KB)      r-xp (03:03 
1928900)  /usr/kde/3.2/lib/libkparts.so.2.1.0
402ca000 (16 KB)       rw-p (03:03 
1928900)  /usr/kde/3.2/lib/libkparts.so.2.1.0
402ce000 (396 KB)      r-xp (03:03 
1756215)  /usr/kde/3.2/lib/libkutils.so.1.2.0
40331000 (20 KB)       rw-p (03:03 
1756215)  /usr/kde/3.2/lib/libkutils.so.1.2.0
40336000 (3084 KB)     r-xp (03:03 1928889)  /usr/kde/3.2/lib/libkio.so.4.2.0
40639000 (112 KB)      rw-p (03:03 1928889)  /usr/kde/3.2/lib/libkio.so.4.2.0
40655000 (12 KB)       rw-p (00:00 0)
40658000 (2556 KB)     r-xp (03:03 
1743502)  /usr/kde/3.2/lib/libkdeui.so.4.2.0
408d7000 (164 KB)      rw-p (03:03 
1743502)  /usr/kde/3.2/lib/libkdeui.so.4.2.0
40900000 (4 KB)        rw-p (00:00 0)
40901000 (2096 KB)     r-xp (03:03 
1733046)  /usr/kde/3.2/lib/libkdecore.so.4.2.0
40b0d000 (64 KB)       rw-p (03:03 
1733046)  /usr/kde/3.2/lib/libkdecore.so.4.2.0
40b1d000 (8 KB)        rw-p (00:00 0)
40b1f000 (172 KB)      r-xp (03:03 1928873)  /usr/kde/3.2/lib/libDCOP.so.4.2.0
40b4a000 (4 KB)        rw-p (03:03 1928873)  /usr/kde/3.2/lib/libDCOP.so.4.2.0
40b4b000 (8 KB)        rw-p (00:00 0)
40b4d000 (6444 KB)     r-xp (03:03 956209)   /usr/qt/3/lib/libqt-mt.so.3.3.0
41198000 (260 KB)      rw-p (03:03 956209)   /usr/qt/3/lib/libqt-mt.so.3.3.0
411d9000 (12 KB)       rw-p (00:00 0)
411dc000 (780 KB)      r-xp (03:03 653286)   /usr/X11R6/lib/libX11.so.6.2
4129f000 (16 KB)       rw-p (03:03 653286)   /usr/X11R6/lib/libX11.so.6.2
412a3000 (796 KB)      r-xp (03:03 
1903813)  /usr/lib/gcc/i586-pc-linux-gnu/3.4.3/libstdc++.so.6.0.3
4136a000 (20 KB)       rw-p (03:03 
1903813)  /usr/lib/gcc/i586-pc-linux-gnu/3.4.3/libstdc++.so.6.0.3
4136f000 (24 KB)       rw-p (00:00 0)
41375000 (132 KB)      r-xp (03:03 970582)   /lib/libm-2.3.3.so
41396000 (4 KB)        rw-p (03:03 970582)   /lib/libm-2.3.3.so
41397000 (156 KB)      r-xp (03:03 
1928880)  /usr/kde/3.2/lib/libkdefx.so.4.2.0
413be000 (8 KB)        rw-p (03:03 
1928880)  /usr/kde/3.2/lib/libkdefx.so.4.2.0
413c0000 (64 KB)       r-xp (03:03 1522484)  /lib/libz.so.1.2.2
413d0000 (4 KB)        rw-p (03:03 1522484)  /lib/libz.so.1.2.2
413d1000 (96 KB)       r-xp (03:03 
1928883)  /usr/kde/3.2/lib/libkdesu.so.4.2.0
413e9000 (4 KB)        rw-p (03:03 
1928883)  /usr/kde/3.2/lib/libkdesu.so.4.2.0
413ea000 (56 KB)       r-xp (03:03 
1928885)  /usr/kde/3.2/lib/libkwalletclient.so.1.0.1
413f8000 (4 KB)        rw-p (03:03 
1928885)  /usr/kde/3.2/lib/libkwalletclient.so.1.0.1
413f9000 (4 KB)        rw-p (00:00 0)
413fa000 (56 KB)       r-xp (03:03 970421)   /lib/libpthread-0.10.so
41408000 (4 KB)        rw-p (03:03 970421)   /lib/libpthread-0.10.so
41409000 (264 KB)      rw-p (00:00 0)
4144b000 (28 KB)       r-xp (03:03 781832)   /usr/lib/libfam.so.0.0.0
41452000 (4 KB)        rw-p (03:03 781832)   /usr/lib/libfam.so.0.0.0
41453000 (32 KB)       r-xp (03:03 
1904025)  /usr/lib/gcc/i586-pc-linux-gnu/3.4.3/libgcc_s.so.1
4145b000 (4 KB)        rw-p (03:03 
1904025)  /usr/lib/gcc/i586-pc-linux-gnu/3.4.3/libgcc_s.so.1
4145c000 (52 KB)       r-xp (03:03 1378019)  /usr/X11R6/lib/libXext.so.6.4
41469000 (4 KB)        rw-p (03:03 1378019)  /usr/X11R6/lib/libXext.so.6.4
4146a000 (96 KB)       r-xp (03:03 680848)   /usr/lib/libart_lgpl_2.so.2.3.16
41482000 (4 KB)        rw-p (03:03 680848)   /usr/lib/libart_lgpl_2.so.2.3.16
41483000 (4 KB)        rw-p (00:00 0)
41484000 (8 KB)        r-xp (03:03 970584)   /lib/libdl-2.3.3.so
41486000 (4 KB)        rw-p (03:03 970584)   /lib/libdl-2.3.3.so
41487000 (28 KB)       r-xp (03:03 1377994)  /usr/X11R6/lib/libSM.so.6.0
4148e000 (4 KB)        rw-p (03:03 1377994)  /usr/X11R6/lib/libSM.so.6.0
4148f000 (80 KB)       r-xp (03:03 653312)   /usr/X11R6/lib/libICE.so.6.3
414a3000 (8 KB)        rw-p (03:03 653312)   /usr/X11R6/lib/libICE.so.6.3
414a5000 (4 KB)        rw-p (00:00 0)
414a6000 (352 KB)      r-xp (03:03 641540)   /usr/lib/libmng.so.1.0.0
414fe000 (12 KB)       rw-p (03:03 641540)   /usr/lib/libmng.so.1.0.0
41501000 (128 KB)      r-xp (03:03 641577)   /usr/lib/libjpeg.so.62.0.0
41521000 (4 KB)        rw-p (03:03 641577)   /usr/lib/libjpeg.so.62.0.0
41522000 (188 KB)      r-xp (03:03 581286)   /usr/lib/libpng.so.3.1.2.5
41551000 (4 KB)        rw-p (03:03 581286)   /usr/lib/libpng.so.3.1.2.5
41552000 (4 KB)        rw-p (00:00 0)
41553000 (28 KB)       r-xp (03:03 653569)   /usr/X11R6/lib/libXi.so.6.0
4155a000 (4 KB)        rw-p (03:03 653569)   /usr/X11R6/lib/libXi.so.6.0
4155b000 (28 KB)       r-xp (03:03 
1743561)  /usr/X11R6/lib/libXrender.so.1.2.2
41562000 (4 KB)        rw-p (03:03 
1743561)  /usr/X11R6/lib/libXrender.so.1.2.2
41563000 (12 KB)       r-xp (03:03 653401)   /usr/X11R6/lib/libXrandr.so.2.0
41566000 (4 KB)        rw-p (03:03 653401)   /usr/X11R6/lib/libXrandr.so.2.0
41567000 (32 KB)       r-xp (03:03 
1743586)  /usr/X11R6/lib/libXcursor.so.1.0.2
4156f000 (4 KB)        rw-p (03:03 
1743586)  /usr/X11R6/lib/libXcursor.so.1.0.2
41570000 (68 KB)       r-xp (03:03 1743575)  /usr/X11R6/lib/libXft.so.2.1.2
41581000 (4 KB)        rw-p (03:03 1743575)  /usr/X11R6/lib/libXft.so.2.1.2
41582000 (416 KB)      r-xp (03:03 495557)   /usr/lib/libfreetype.so.6.3.4
415ea000 (28 KB)       rw-p (03:03 495557)   /usr/lib/libfreetype.so.6.3.4
415f1000 (4 KB)        rw-p (00:00 0)
415f2000 (136 KB)      r-xp (03:03 
1743568)  /usr/X11R6/lib/libfontconfig.so.1.0.4
41614000 (12 KB)       rw-p (03:03 
1743568)  /usr/X11R6/lib/libfontconfig.so.1.0.4
41617000 (4 KB)        rw-p (00:00 0)
41618000 (688 KB)      r-xp (03:03 
704992)   /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.2/libstdc++.so.5.0.5
416c4000 (20 KB)       rw-p (03:03 
704992)   /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.2/libstdc++.so.5.0.5
416c9000 (20 KB)       rw-p (00:00 0)
416ce000 (140 KB)      r-xp (03:03 496844)   /usr/lib/libexpat.so.0.5.0
416f1000 (8 KB)        rw-p (03:03 496844)   /usr/lib/libexpat.so.0.5.0
416f3000 (8 KB)        rw-p (00:00 0)
416f5000 (2048 KB)     r--p (03:03 970642)   /usr/lib/locale/locale-archive
418f5000 (1072 KB)     r--p (03:03 970642)   /usr/lib/locale/locale-archive
41a01000 (4 KB)        r--p (03:03 970642)   /usr/lib/locale/locale-archive
41a02000 (24 KB)       r--s (03:03 
735470)   /usr/lib/gconv/gconv-modules.cache
41a08000 (4 KB)        r-xp (03:03 
653306)   /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
41a09000 (4 KB)        rw-p (03:03 
653306)   /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
41a0a000 (104 KB)      r-xp (03:03 
654419)   /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
41a24000 (8 KB)        rw-p (03:03 
654419)   /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
41a26000 (136 KB)      r--p (03:03 
1077257)  /usr/kde/3.2/share/locale/it/LC_MESSAGES/kdelibs.mo
41a54000 (100 KB)      r-xp (03:03 
1745347)  /usr/kde/3.2/lib/kde3/plugins/styles/plastik.so
41a6d000 (4 KB)        rw-p (03:03 
1745347)  /usr/kde/3.2/lib/kde3/plugins/styles/plastik.so
41a6e000 (1048 KB)     r--s (03:03 1559807)  /var/tmp/kdecache-dario/ksycoca
41b74000 (128 KB)      rw-p (00:00 0)
41ba0000 (36 KB)       r--p (03:03 
970361)   /usr/share/locale/it/LC_MESSAGES/libc.mo
41ba9000 (8 KB)        r-xp (03:03 968180)   /usr/lib/gconv/ISO8859-1.so
41bab000 (4 KB)        rw-p (03:03 968180)   /usr/lib/gconv/ISO8859-1.so
41bac000 (8 KB)        r--p (03:03 
655437)   /usr/X11R6/lib/X11/fonts/75dpi/helvR14-ISO8859-1.pcf.gz
41bae000 (24 KB)       r-xp (03:03 
1440863)  /usr/kde/3.2/lib/kde3/libautorefresh.so
41bb4000 (4 KB)        rw-p (03:03 
1440863)  /usr/kde/3.2/lib/kde3/libautorefresh.so
41bc1000 (8 KB)        r-xp (03:03 681515)   /usr/lib/libpcreposix.so.0.0.0
41bc3000 (4 KB)        rw-p (03:03 681515)   /usr/lib/libpcreposix.so.0.0.0
41bc4000 (60 KB)       r-xp (03:03 970441)   /lib/libresolv-2.3.3.so
41bd3000 (4 KB)        rw-p (03:03 970441)   /lib/libresolv-2.3.3.so
41bd4000 (8 KB)        rw-p (00:00 0)
41bd6000 (8 KB)        r-xp (03:03 970463)   /lib/libutil-2.3.3.so
41bd8000 (4 KB)        rw-p (03:03 970463)   /lib/libutil-2.3.3.so
41bdd000 (28 KB)       r-xp (03:03 970621)   /lib/libnss_compat-2.3.3.so
41be4000 (4 KB)        rw-p (03:03 970621)   /lib/libnss_compat-2.3.3.so
41be5000 (72 KB)       r-xp (03:03 970439)   /lib/libnsl-2.3.3.so
41bf7000 (4 KB)        rw-p (03:03 970439)   /lib/libnsl-2.3.3.so
41bf8000 (8 KB)        rw-p (00:00 0)
41bfa000 (32 KB)       r-xp (03:03 970454)   /lib/libnss_nis-2.3.3.so
41c02000 (4 KB)        rw-p (03:03 970454)   /lib/libnss_nis-2.3.3.so
41c03000 (32 KB)       r-xp (03:03 970275)   /lib/libnss_files-2.3.3.so
41c0b000 (4 KB)        rw-p (03:03 970275)   /lib/libnss_files-2.3.3.so
41c0c000 (4 KB)        r-xp (03:03 
1928597)  /usr/kde/3.2/lib/kde3/libkhtmlpart.so
41c0d000 (4 KB)        rw-p (03:03 
1928597)  /usr/kde/3.2/lib/kde3/libkhtmlpart.so
41c0e000 (3096 KB)     r-xp (03:03 
1928557)  /usr/kde/3.2/lib/libkhtml.so.4.2.0
41f14000 (140 KB)      rw-p (03:03 
1928557)  /usr/kde/3.2/lib/libkhtml.so.4.2.0
41f37000 (360 KB)      r-xp (03:03 1928884)  /usr/kde/3.2/lib/libkjs.so.1.2.0
41f91000 (20 KB)       rw-p (03:03 1928884)  /usr/kde/3.2/lib/libkjs.so.1.2.0
41f96000 (4 KB)        rw-p (00:00 0)
41f97000 (696 KB)      r-xp (03:03 
1928942)  /usr/kde/3.2/lib/libkdeprint.so.4.2.0
42045000 (32 KB)       rw-p (03:03 
1928942)  /usr/kde/3.2/lib/libkdeprint.so.4.2.0
42059000 (60 KB)       r-xp (03:03 681380)   /usr/lib/libpcre.so.0.0.1
42068000 (4 KB)        rw-p (03:03 681380)   /usr/lib/libpcre.so.0.0.1
42069000 (128 KB)      rw-p (00:00 0)
4208d000 (28 KB)       r-xp (03:03 
1440166)  /usr/kde/3.2/lib/kde3/libcrashesplugin.so
42094000 (4 KB)        rw-p (03:03 
1440166)  /usr/kde/3.2/lib/kde3/libcrashesplugin.so
42096000 (60 KB)       r-xp (03:03 
1722282)  /usr/kde/3.2/lib/kde3/khtml_kget.so
420a5000 (8 KB)        rw-p (03:03 
1722282)  /usr/kde/3.2/lib/kde3/khtml_kget.so
420a7000 (8 KB)        r-xp (03:03 1743558)  /usr/X11R6/lib/libXinerama.so.1.0
420a9000 (4 KB)        rw-p (03:03 1743558)  /usr/X11R6/lib/libXinerama.so.1.0
420b1000 (32 KB)       r-xp (03:03 
1440526)  /usr/kde/3.2/lib/kde3/libminitoolsplugin.so
420b9000 (4 KB)        rw-p (03:03 
1440526)  /usr/kde/3.2/lib/kde3/libminitoolsplugin.so
420d5000 (36 KB)       r-xp (03:03 
1440416)  /usr/kde/3.2/lib/kde3/libkhtmlsettingsplugin.so
420de000 (4 KB)        rw-p (03:03 
1440416)  /usr/kde/3.2/lib/kde3/libkhtmlsettingsplugin.so
420df000 (32 KB)       r-xp (03:03 
1440360)  /usr/kde/3.2/lib/kde3/libbabelfishplugin.so
420e7000 (4 KB)        rw-p (03:03 
1440360)  /usr/kde/3.2/lib/kde3/libbabelfishplugin.so
420e8000 (72 KB)       r-xp (03:03 
1440540)  /usr/kde/3.2/lib/kde3/libdomtreeviewerplugin.so
420fa000 (4 KB)        rw-p (03:03 
1440540)  /usr/kde/3.2/lib/kde3/libdomtreeviewerplugin.so
420fb000 (52 KB)       r-xp (03:03 
1441088)  /usr/kde/3.2/lib/kde3/libvalidatorsplugin.so
42108000 (4 KB)        rw-p (03:03 
1441088)  /usr/kde/3.2/lib/kde3/libvalidatorsplugin.so
42109000 (100 KB)      r-xp (03:03 
1441033)  /usr/kde/3.2/lib/kde3/libwebarchiverplugin.so
42122000 (4 KB)        rw-p (03:03 
1441033)  /usr/kde/3.2/lib/kde3/libwebarchiverplugin.so
42123000 (48 KB)       r-xp (03:03 
1441247)  /usr/kde/3.2/lib/kde3/libuachangerplugin.so
4212f000 (4 KB)        rw-p (03:03 
1441247)  /usr/kde/3.2/lib/kde3/libuachangerplugin.so
42130000 (32 KB)       r-xp (03:03 
653308)   /usr/X11R6/lib/X11/locale/lib/common/xomGeneric.so.2
42138000 (4 KB)        rw-p (03:03 
653308)   /usr/X11R6/lib/X11/locale/lib/common/xomGeneric.so.2
42139000 (16 KB)       r--p (03:03 
657227)   /usr/X11R6/lib/X11/fonts/100dpi/helvR08.pcf.gz
4213d000 (140 KB)      rw-p (00:00 0)
42160000 (8 KB)        r--p (03:03 
657309)   /usr/X11R6/lib/X11/fonts/100dpi/helvB18-ISO8859-1.pcf.gz
4216f000 (28 KB)       rw-p (00:00 0)
42176000 (8 KB)        r--p (03:03 
657325)   /usr/X11R6/lib/X11/fonts/100dpi/helvR12-ISO8859-1.pcf.gz
42178000 (916 KB)      rw-p (00:00 0)
42261000 (4 KB)        rw-p (00:00 0)
42262000 (68 KB)       r--p (03:03 
661653)   /usr/X11R6/lib/X11/fonts/TTF/Vera.ttf
42282000 (8 KB)        rw-p (00:00 0)
42284000 (64 KB)       r--p (03:03 
1744827)  /usr/X11R6/lib/X11/fonts/TTF/VeraIt.ttf
422a4000 (8 KB)        r--p (03:03 
655436)   /usr/X11R6/lib/X11/fonts/75dpi/helvR12-ISO8859-1.pcf.gz
422a6000 (4 KB)        rw-p (00:00 0)
422a7000 (140 KB)      r--p (03:03 905516)   /home/dario/.fonts/verdana.ttf
422ca000 (136 KB)      r--p (03:03 1178067)  /home/dario/.fonts/verdana2.ttf
422ec000 (4 KB)        rw-p (00:00 0)
42311000 (284 KB)      r--p (03:03 1044279)  /home/dario/.fonts/arialbd0.ttf
42358000 (272 KB)      r--p (03:03 
660979)   /usr/X11R6/lib/X11/fonts/truetype/arial.ttf
423a0000 (8 KB)        r--p (03:03 
655416)   /usr/X11R6/lib/X11/fonts/75dpi/helvB08-ISO8859-1.pcf.gz
423a8000 (4 KB)        r--p (03:03 
657299)   /usr/X11R6/lib/X11/fonts/100dpi/courR08-ISO8859-1.pcf.gz
423a9000 (8 KB)        r--p (03:03 
657326)   /usr/X11R6/lib/X11/fonts/100dpi/helvR14-ISO8859-1.pcf.gz
423ab000 (16 KB)       r--p (03:03 
655338)   /usr/X11R6/lib/X11/fonts/75dpi/helvR08.pcf.gz
423af000 (384 KB)      rw-p (00:00 0)
4240f000 (204 KB)      r--p (03:03 
660982)   /usr/X11R6/lib/X11/fonts/truetype/ariali.ttf
42442000 (16 KB)       r--p (03:03 
655334)   /usr/X11R6/lib/X11/fonts/75dpi/helvO12.pcf.gz
bffef000 (68 KB)       rwxp (00:00 0)
ffffe000 (4 KB)        ---p (00:00 0)
mapped:   59780 KB writable/private: 26792 KB shared: 1072 KB


I really don't know why there is such a gap. But since we know that there is 
this problem, what about setting the memory thereshold from 16Mbytes to 8 
Mbytes? 
Or better make a thereshold that depends on the current amount of ram. 
Something like:
Ram					Thereshold
512Mb or higher		16Mb
256Mb				8Mb
128Mb				4Mb

Cheers, 
	Dario




More information about the kfm-devel mailing list