[TriLUG] Re: [TriLUG] Re: RH 9 install & bad ram  

Nathan Conrad conrad at bungled.net
Tue Jul 15 22:29:13 EDT 2003


Swap is helpful when you run programs that use up a lot of RAM by
reading in large amounts of data at one time. It is also helpful to
run many programs at the same time. The operating system will decide
which pieces of data in RAM are not being used and store them on the
hard drive. The OS will then automatically read them from the hard
drive when they are needed.

The problem with this method is that it is slow. Upgrading RAM will
help your machine a lot more than bumping up the amount of swap. While
running your CPU intensive tasks, you can use the 'free' command to
view how much RAM is free and how much SWAP is free:

My machine shows:
             total       used       free     shared    buffers cached
Mem:        514292     500592      13700          0      53012 258448
-/+ buffers/cache:     189132     325160
Swap:       262136      41792     220344

You can see that I'm using 500 MB of my RAM, although 258 MB of that
is for caching files on disk, so my programs are actually using about
240 MB of RAM. Only 40 MB of my swap is used, and I'm guessing that
most of this is used by programs that are inactive because I have so
much (240 MB) of 'free' RAM.

Another strategy is to look at the usage of individual processes. For
example, on my machine `ps aux | grep X` gives:

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root      4157  1.9  8.9 73844 45772 ?       S<   Jul14  36:44 /usr/bin/X11/X :0 -deferglyphs 16 -nolisten tcp -auth /var/lib/gdm/:0.Xauth vt7

Look at the VSZ "Virtual Size" column. It shows that X is using about
70 MB of RAM on my machine.

To sum this up: If you care about speed: Use lots of real RAM, and maybe use
1/2 GB of swap. But, you need to always make sure that the sum of the
RAM usage of your programs is always less than the sum of swap and
RAM, or else the kernel may decide to kill your processes.


-Nathan

> Hi Nathan-
> 
> Thanks for the response ... re: the 2GB swap ... I may do a fair
> amount of computationally intensive calculations (one run taking 2+
> hrs as far as I've seen). In what cases would increasing the swap be
> beneficial?
>
> I'm going to run the memory tests over the next day or so as well...

Thanks,
Doug

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://www.trilug.org/pipermail/trilug/attachments/20030715/4b590808/attachment.pgp>


More information about the TriLUG mailing list