[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Memory Usage
From: Andreas Pour <pour () mieterra ! com>
Date: 2000-04-26 23:49:27
[Download RAW message or body]
Hi,
When viewing a not-so-realistic file -- like this:
<HTML>
<BODY>
11<BR>
. . . (repeat 11<BR> about 55,000 times)
11<BR>
</BODY>
</HTML>
I noticed a couple of (well, three) strange things in Konqi.
First, it takes a long time -- about 20 seconds on a 350Mhz processor --
to open the file. It takes vi about 1/10th of a second. To quantify
this, I used vi to open this file:
time vi test.html
0.08user 0.01system 0:00.90elapsed 9%CPU (0avgtext+0avgdata
0maxresident)k
Then I used konqueror (3 tests):
time konqueror test.html
24.43user 0.65system 0:30.07elapsed 83%CPU (0avgtext+0avgdata
0maxresident)k
26.19user 0.66system 0:30.38elapsed 88%CPU (0avgtext+0avgdata
0maxresident)k
24.67user 0.68system 0:28.76elapsed 88%CPU (0avgtext+0avgdata
0maxresident)k
To shave off the overhead from starting konqueror (I restarted konqueror
each time), I ran konqueror with the same file as above, without the
extra 55,000 lines:
3.33user 0.15system 0:09.00elapsed 38%CPU (0avgtext+0avgdata
0maxresident)k
3.38user 0.13system 0:06.49elapsed 54%CPU (0avgtext+0avgdata
0maxresident)k
3.28user 0.19system 0:08.00elapsed 43%CPU (0avgtext+0avgdata
0maxresident)k
Thus, it took 20 seconds of full CPU time to parse this file
(layout/rendering shouldn't take very long since no widgets are created
and the layout is very simple). And since the great bulk of this time
is spent by kio_file loading the file, I don't know why konqi burns the
CPU on this.
Second, memory usage seemed somewhat excessive. Starting konqueror with
the small test file:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1554 pts/8 S 0:03 2372 2 15729 10676 8.3 konqueror
/tmp/tests.html
Using the large test file:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1563 pts/8 S 0:24 2380 2 44473 39452 30.8 konqueror
/tmp/test.html
So for a file of size 382,398 bytes, Konqi is using 30Mbytes of memory.
I tried a medium test file of 5000 of the '11<BR>' lines (size = 35002
bytes) and memory usage was:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1954 pts/8 S 0:05 2939 2 18105 13048 10.2 konqueror
/tmp/testm.html
Plugging together my 3 data points, I get the rough formula:
10.6MB + 70 * filesize
which seems a lot for a file with such a simple layout.
Just out of curiosity, I removed all the <BR>'s and put the 55,000 lines
of '11' between <PRE> tags, and the result was:
time konqueror /tmp/testp.html
7.86user 0.44system 0:14.31elapsed 57%CPU (0avgtext+0avgdata
0maxresident)k
and memory usage was:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1978 pts/8 S 0:07 2373 2 19617 14568 11.3 konqueror
/tmp/testp.html
So about 16 seconds faster and about 1/7th the memory consumption . . .
.
Third, the file is displayed strangely. The first roughly 10% of the
lines have what appear to be two blobs in each line, which should be
1's. The rest of the lines are empty -- it appears as if lines are
being drawn on top of each other, but offset horizontally a bit. (The
small and medium files display correctly but the display with the <PR>
tags was even stranger -- 3 blobs per line for about the first 7% and
the rest of the lines empty).
Ciao,
Andreas
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic