[SLUG] LPI: Swap space size

john at johnallsopp.co.uk john at johnallsopp.co.uk
Tue Aug 16 08:20:27 BST 2005


Hi lpiers

I'm reading this in the HOWTOs about how much disc swap space to
create and it makes no sense, can anyone shed any light on it?:

> A very old rule of thumb in the days of the PDP and the Vax was that
the size of the working set of a program is about 25% of its virtual
size. Thus it is probably useless to provide more swap than three
times your RAM.

It doesn't say what a working set is (so
<http://www.google.co.uk/search?hl=en&q=define%3A+working+set&btnG=Google+Search&meta=>).
Anyway, what's the 'virtual size' of a program? Can we assume that's
the space it occupies in RAM/swap while running? So maybe he's saying
that in general the program itself occupies three times the space it
needs for its working set (the memory addresses it thinks it'll use
soon).

So by what jump do we reach "Thus it is probably useless to provide
more swap than three times your RAM"? Are we perhaps saying that the
working set, since it's dynamic, is in RAM, while the program itself,
since it stays the same, sits in swap space?

> But keep in mind that this is just a rule of thumb. It is easily
possible to create scenarios where programs have extremely large or
extremely small working sets. For example, a simulation program with
a large data set that is accessed in a very random fashion would
have almost no noticeable locality of reference in its data segment,
so its working set would be quite large.

Soooooooo? Big swap space required? Little swap space required?

> On the other hand, an xv

a what?

> with many simultaneously opened JPEGs, all but one iconified, would
have a very large data segment. But image transformations are all
done on one single image, most of the memory occupied by xv is never
touched. The same is true for an editor with many editor windows
where only one window is being modified at a time. These programs
have - if they are designed properly - a very high locality of
reference and large parts of them can be kept swapped out without
too severe performance impact.

Soooooooo? Big swap space required? Little swap space required?

Help.

J




More information about the Scarborough mailing list