some memory/swap thoughts

Jan Gyselinck (JAN.GYSELINCK@student.kuleuven.ac.be)
Wed, 18 Mar 1998 16:11:30 +0100 (W. Europe Standard Time)


Hi all

My experience comes from a 2.1.89 kernel. While the following may not
apply anymore, my conclusions will still apply for newer kernels, so read
on.

A got a P75 portable with 16 megs. The memory-code (or the thing that
loves to put things in swap) in .89 thinks is should keep something like 5
to 6 meg as a cache. That leaves me with 10 megs of memory, and some 1.5
megs is already taken by the kernel. Imagine: you're compiling something,
you're bzipping something (and that needs 8.5 meg), so if you do that,
you'll know what swapping is. Even a sole bzip can't run without
swapping, with used to run without (or with some swapping in the
beginning, but never while running).

I think that the people who designed this 'feature' did one thing wrong.
Namely they turned things around. Memory is not made to use if as a
cache, it's used to run programs from. Programs are not made to be run
from swap.

Now, 5 meg as a cache, isn't that too much?? Some people think this is
needed, well I can tell you, it isn't. A year ago, I did some testing on
a 486DX33 with 8 meg, running DOS/winslows 3.11. I tried different
cache-sizes (with pc-cache) and measured the speedup while starting up
MS-Word. Maybe you think that's not the way to test this, but why not?
You test the speed-up in real-life applications, because that's what you
do all day. So, speedup from 0 to 64 kB cache, 20 seconds, from 64 to 128
kB cache, 14 seconds, from 128 to 256 kB, 6 seconds, from 256 to 512 kB, 3
seconds, and from 512 to 1024 kB, 1 second. Now why in gods name would
one want 5 meg of cache? It will increase the speed of disk-activity with
maybe 1 second of a 2,5 meg cache. My oppinion is that for 16 meg of
memory, the minimum-limit for a disk-cache should be 256kB, not 5 meg!!

Okay, you say, but what about all those idling programs that are stuck in
memory, and just take up memory from the cache. I know, I know, there are
cases where it's needed to run such programs, but not always. People are
running to many idle programs these days! Why do you think there is a
inet-daemon? So that there don't need to be a dozen idle processes who
are checking if there isn't something knocking on there port. Running 6
or more agetty's? There exists something like a console spawn daemon, you
push a key-combination, and there opens a new console.

If I run a bash on a console, and I do something on another console for a
while, and I return to the first one, I want the bash-process to respond
immediatly to my key-strokes. I don't like to wait for it until it's
loaded from swap. My opinion is this: if I run something, it is because
it needs to run, and it must be able to respond immediatly. If this is
not so, I wont run it. I don't have memory to throw around, I need every
bit. (And no, memory for a portable is not that cheap)

So think about this, when you people change something in the
memory-management of linux, because it'll run on low-budget and
high-budget systems...

Jan Gyselink
for the moment a swapping linux-user

PS: i hope .90 is better, 'll try it tonight, but after I rebooted,
because my console is messed up by Xwindows, who didn't restore the state
after it finished (maybe caused by to much swapping?????)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu