Re: How much swap?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Uno Engborg wrote:

Would I need a swap anyway.  There is some old rule of thumb to have
 twice as much virtual memory as you have physical RAM, but that
sounds a bit ridiculous  as it would take a lot of time to swap
in/out this much memory from disk.

I used to think it was kind of ridiculous, myself, until I discovered a quirk of Posix's behavior. If I get any of these details wrong, I invite corrections:

When a process called fork() on an old unix system, the OS required an amount of free memory equal to the size of the process, plus the size of a process table entry. If this memory wasn't free, fork() would fail. After fork(), the OS would copy the full set of memory from the parent process to the new process. Since fork() is so often followed by exec(), which throws away all of that memory, modern unix systems don't copy the whole set of memory when a process forks. However, they still require that there is enough memory to do so (at least normally; Linux has an "overcommit" feature that you can enable).

With 8GB of RAM, that may not affect you directly, but it may, too. Lets say that you have no swap, and you were using a 3d modeler, or high-end graphics package. If that application was using 5GB of your 8, and needed to launch a helper application, like an out-of-process perl or python script, it wouldn't be able to do so. Even though that script only needs a few MB of the GB you have free, the parent is too big to fork(), so it can't spawn new processes.

So, when you decide whether or not to follow the traditional advice offered about the amount of swap to allocate, you should first understand how the Linux VM works:
http://www.redhat.com/magazine/001nov04/features/vm/

...if you don't want to spend the time learning the details, I'd just stick with the advice offered.

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux