What is Virtual Memory and where can I get detailed information on its implementation in Red Hat Enterprise Linux?
The concept behind Virtual Memory is using a disk as an extension of RAM so that the effective size of usable memory grows correspondingly. The kernel writes the contents of a currently unused block of memory to the hard disk so that the memory can be used for another purpose. When the original contents are needed again, they are read back into memory. This is all made completely transparent to the user; only the programs see the larger amount of memory available and don't notice that parts of them reside on the disk from time to time. Reading and writing the hard disk is slower than using real memory, so the programs do not run as fast. The part of the hard disk that is used as virtual memory is called the swap space.
Linux can use either a normal file in the filesystem or a separate partition for swap space. A swap partition is faster, but it is easier to change the size of a swap file (there's no need to repartition the whole hard disk, and possibly install everything from scratch). When space required for the swap is known, create a swap partition, otherwise use a swap file first, to have an idea of how much swap is required, and then make a swap partition.
A Note on operating system terminology: Computer science usually distinguishes between swapping (writing the whole process out to swap space) and paging (writing only fixed size parts, usually a few kilobytes, at a time). Paging is usually more efficient, and is implemented in Linux, but traditional Linux terminology talks about swapping.
Here are the links to the documents useful in understanding the concept of Virtual Memory in Red Hat Enterprise Linux:
- Informations on the Virtual Memory:
http://www.redhat.com/magazine/001nov04/features/vm/
- Understanding Virtual Memory in Red Hat Enterprise Linux 3:
http://people.redhat.com/nhorman/papers/rhel3_vm.pdf
- Understanding Virtual Memory In Red Hat Enterprise Linux 4:
http://people.redhat.com/nhorman/papers/rhel4_vm.pdf
- Tuning Red Hat Enterprise Linux for Oracle:
http://www.puschitz.com/TuningLinuxForOracle.shtml

Comments