The backing store for a virtual memory operating system is typically many orders of magnitude slower than RAM. Therefore it is desirable to reduce or eliminate swapping, where practical. Some operating systems offer settings to influence the kernel's decisions.
- Linux offers the
/proc/sys/vm/swappinessparameter, which changes the balance between swapping out runtime memory, as opposed to dropping pages from the system page cache. - Windows 2000, XP, and Vista offer the
DisablePagingExecutiveregistry setting, which controls whether kernel-mode code and data can be eligible for paging out. - Mainframe computers frequently used head-per-track disk drives or drums for swap storage to eliminate the latency implicit in seeking a moveable head.
- Flash memory devices have an inherent life limitation which makes them inappropriate for general-purpose swapspace. However schemes such as ReadyBoost may be used to preload binaries or other read-only data into the virtual memory space.
Many Unix-like operating systems (for example AIX, Linux and Solaris) allow using multiple storage devices for swap space in parallel, to increase performance.
Tuning swap space size
In some older virtual memory operating systems, space in swap backing store is reserved when programs allocate memory for runtime data. OS vendors typically issue guidelines about how much swap space should be allocated. Between 1.5 or 2 times the installed RAM is a typical number [10]. With a large amount of RAM, the disk space needed for the backing store can be very large. Newer versions of these operating systems attempt to solve this problem: for example, some HP-UX kernels offer a tunable swapmem_on that controls whether RAM can be used for memory reservations. In systems with sufficient RAM, this significantly reduces the needed space allocation for the backing store.
It is not uncommon to find 32 bit computers with 4 GiB of RAM, the maximum amount addressable without the use of PAE.
Swap space can be used beyond this 4 GiB limit, due to it being addressed in terms of pages rather than individual bytes.
While 32 bit programs will continue to be limited to the 4 GiB they're capable of addressing, because they each exist in their own virtual address space, a group of programs can together grow beyond this limit and into any available swap space.
No comments:
Post a Comment