Quote:> I've heard a lot of people discussing swap space ... what is
> this used for?
> I've just started using GNU/Linux RH6.2, and I've allocated
> all of the 2gb hd to it. Was this a bad idea? Should I have
> allocated some swap??
> I'm not too late to do a full install.
Hm. A decent OS book could give a better, more thorough description
than I. But basically...
Approximately, swap is to main memory as main memory is to cache; it
has a much larger capacity, but higher latency. Pages containing
seldom-used data (that is still nominally in memory) can be written
to disk in order to make room for pages that ARE more actively used.
For instance, on a typical single-user Linux box, there are getty
(or mingetty, or other variants) running on all the virtual
consoles, but most are going to be completely idle. They can be
swapped out to disk, since it is unlikely that they'll be used and
in the meantime that (physical) memory that is freed could be better
used for, say, Quake.
So if you've got 128MB of physical RAM and 256MB of swap (note that
*older*, 2.0.x kernels limited you to 128 MB per swap partition),
you might nominally have 200MB of stuff (code/data) stored in
"memory". But if most of that belongs to programs that have been
idly waiting for keypresses for an hour, much can be stored on disk
so as to free up much faster physical RAM.
As to whether you need swap: unless you need the disk space for
other purposes, it generally won't *hurt*, because if there really
isn't anything that can reasonably be swapped out, the kernel isn't
obliged to do so. It really depends on how much memory you consume
on a regular basis (like using Netscape, StarOffice, and Civ:CTP
together might be a BAD idea).
Note that you can use either a swap partition or a swap file, as
well...
--
|--------------------------| he writes really bad haiku |
| #include <stddiscl.h> | readers all go mad |