Re: Is a swap partition still necessary in Linux?

From: Floyd L. Davidson (floyd_at_barrow.com)
Date: 08/22/04


Date: Sun, 22 Aug 2004 07:58:32 -0800

Jeroen Geilman <not@rtpada.ln> wrote:
>Floyd L. Davidson wrote:
>> Jeroen Geilman <not@rtpada.ln> wrote:
>>
>>>>and it is good to have some swap available.
>>>
>>>Duh.
>>>Not only is it good, it is *required*.
>
>> It is not required.
>
>Let me qualify that:
>
>If you want to run without swap available (any kind) then
>running out of memory will invariably cause a kernel panic -
>dead.dead.dead.

Whether you have swap or not, you get an out of memory condition
when all _virtual_ _memory_ is exhausted; hence, if you have
256Mb of RAM and 256Mb of swap you can convert that to "virtual
memory" consisting of 512Mb of RAM only and have *exactly* the
same circumstances, except of course the later instance will 1)
be faster and 2) will not have any swap.

>This behaviour is unavoidable without kernel patches.

Typically the kernel starts killing off processes. It also
slows to a crawl. And to verify that, I just tried it on a
system that has only 64Mb of RAM, which makes it easy to cause
an out of memory condition by simply using xv to display half a
dozen images. Here's what the syslog entries were,

 Aug 22 07:45:53 cash kernel: Out of Memory: Killed process 2360 (bash).
 Aug 22 07:47:10 cash kernel: Out of Memory: Killed process 2215 (xterm).

No kernel panic. And given that it was my login shell and the
xterm it was displayed in, I didn't even need to reboot the
machine!

-- 
FloydL. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com


Relevant Pages

  • 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: How to set up a Linux machine that occupies the minimum memory footprint ?
    ... >> memory and hence causes the kernel to 'thrash' thus slowing down the ... 4GB physical RAM + 4GB swap area) the application will think that it can ... 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 ?
    ... >> memory and hence causes the kernel to 'thrash' thus slowing down the ... 4GB physical RAM + 4GB swap area) the application will think that it can ... You've said in another message that your app is ...
    (comp.os.linux.misc)
  • Re: fedora-list Digest, Vol 10, Issue 167
    ... Well, I have two 433 MHz Celerons and 288 MB RAM, and no performance ... > The memory usage is always around 400MB. ... I'd like to introduce you to the vmstat command. ... > I know that SWAP should be double the Physical RAM but I don't have ...
    (Fedora)
  • Re: FreeBSD data size tuning
    ... It seems there is a memory issue in 4.9 where they adapted 5.x things ... RAM and using 2500MB of swap on ide disk, ... With 1GB of RAM you should be able to run squid without any ...
    (freebsd-performance)