[LUAU] Running a standard distro without swap space

Jim Thompson jim at netgate.com
Wed May 11 19:00:36 PDT 2005


On May 11, 2005, at 2:34 PM, Charles Lockhart wrote:

> Any ideas on how well a machine running a popular distribution of 
> Linux (RH, FCx, Mandrake, Debian, etc) would do if the machine had no 
> swap partition?  Anybody actually do it?  If so, how well did work?

its done all the time on the various embedded systems based on linux.   
Given that most distributions
aren't coupled beyond glibc, I wouldn't anticipate any major problems.

However, with swap, the least used pages can be evicted from physical 
memory. Without it, there may be no place to put the least used pages 
and more frequently used pages have to be evicted.  Additionally, 
without swap, the only pages that *can* be evicted are those that are 
demand-paged out of some executable (on the filesystem).

On a modern operating system like linux, pretty much all of your 
physical memory is in use all the time.
Physical memory will always get full because the OS will always keep 
copies of file data in memory just in case it needs them again. Because 
new pages are always being read in and processes are always allocating 
new memory, the OS will have to make a decision of what pages to evict 
from physical memory. If a page is dirty, and there is no backing store 
(that it, its not a page from a modified file), it can only be evicted 
if there's swap. So if you have dirty pages that are very rarely used, 
swap allows you to keep more hot/clean pages in memory.

Without swap, dirty pages (pages which have been changed but not 
written back) cannot be evicted from physical memory, even if they 
haven't been used for days. If your physical memory exceeds your 
working set size, you win no matter what. But without swap, every dirty 
page is part of your working set, even if it hasn't been read/written 
for days.

A lot of people feel subjectively that swap makes a system slow. 
There's anecdotal evidence that swap does horrible things or "must be 
badly broken because the machine gets slow" on almost every operating 
system that supports swapping. In most cases, it's just a case where 
the real working set has exceeded physical memory, and in that case, 
swap is just doing what it's supposed to be doing.

The speed of hard disks doesn't grow anywhere near as fast as the size 
of memory and applications. This means that over the last years, 
swapping in any particular application has gotten relatively slower 
than it used to be ...

jim




More information about the LUAU mailing list