Re: What size for the swap with a kernel 2.4x and 8GB RAM



s45_nospam@xxxxxxx wrote:
Hi,

On a RedHat AS3 with a kernel 2.4.21 and 8 GB of Memory,

I have Red Hat Enterprise Linux 3 ES with 8 GB of memory as well.
My kernel is 2.4.21-40.ELhugemem that I got March 15 with their major update #7.

what is the
minimum requirement for the swap size.

If you run the machine as I do, you might get by with none. I have 8 GBytes
of swap space, the machine has been running since March 15 and has not paged
at all since then. Your load may be different from mine, however.

My system is set up to forbid core dumps (ulimit: core file size=0).
Does the rule Swap Size= 2 X RAM still applies with big RAM like 8GB? I
don't think so.

With some versions of UNIX, it used to be true that you needed at least as
much swap space as the running process required, even if it turned out that
they would never be swapped out. If I am not mistaken, Linux never worked
that way, and if all your processes would fit in memory you needed no swap
space at all. In either case, it makes sense to allocate some swap space,
except in dedicated embedded systems, just in case. How much depends on what
you are doing. Why not make 2 GBytes partition for paging and see if you use
much of it. If so, make another paging partition on a different hard drive.
If you are doing a lot of paging, you need more memory.

I never thought much of the 2x rule for Linux. In fact any such rule for
Linux makes little sense. If you have little memory, having double that in
paging space might not be enough, and if you have 8 GBytes, you might never
need any. Now if you do not have enough RAM, making the swap space larger is
not the answer; putting more RAM in the machine is the answer. And if I ran
out of space on this thing (unlikely), I can go up only to 16 GBytes because
of limitations of the mother board, and limited to 64 GBytes by limitations
of the processors and chip set.

Does the rule Swap Size= 1 X RAM must be followed even if only part of
RAM is used (1 Gb free for 8 GB total RAM)?
Do you know the rules for working confortably and the the rules that
are a requirement and must be totally followed?

Yes: add up the working set size of all the processes, including the kernel.
Subtract that from the amount of RAM you have. If the result is positive,
you need no swap space. If negative, you need some.

Sylvain



--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 14:40:01 up 4 days, 15:51, 3 users, load average: 4.20, 4.35, 4.25
.



Relevant Pages

  • Re: How to set up a Linux machine that occupies the minimum memory footprint ?
    ... Of course, if you use 8GB of RAM, or more precisely if you ... Are you saying that if I have a 4GB RAM memory, ... Linux will somehow "know" that it doesn't have ... You've said in another message that your app is ...
    (comp.os.linux.setup)
  • Re: How to set up a Linux machine that occupies the minimum memory footprint ?
    ... Of course, if you use 8GB of RAM, or more precisely if you ... Are you saying that if I have a 4GB RAM memory, ... Linux will somehow "know" that it doesn't have ... You've said in another message that your app is ...
    (comp.os.linux.misc)
  • Re: OT (slightly) swap limits
    ... influence your decision on how much swap was enough. ... processes due to lack of memory. ... I've run machines with 1Gig or more RAM with NO SWAP. ... Linux possible when before on Unix it wasn't? ...
    (Debian-User)
  • Re: oom-killer vs system not reachable
    ... Do you think that Linux might stop to respond or get stuck ... Another situation is that several processes are competing for memory, ... in ram at once. ... is to monitor or log what happens when the system dies like this, ...
    (Debian-User)
  • Re: "Insufficient virtual memory" error message in Linux
    ... My problem is that if I tell the program to use more than 2 GB of ram the program eventually crashes with a message "insufficient virtual memory". ... I am still trying to understand if this issue arises because of an intrinsic limit of the CPU, of linux or of the compiler. ...
    (comp.lang.fortran)