Information AboutPaging |
| CATEGORIES ABOUT PAGING | |
| virtual memory | |
| memory management | |
Alternate meanings: See Pager . See Radio Paging . Bank Switching is also sometimes referred to as paging. In Computer Operating System s, paging Memory Allocation , paging refers to the process of managing program access to Virtual Memory pages that do not currently reside in RAM . It is implemented as a Task that resides in the kernel of the operating system and gains control when a Page Fault takes place. Its main functions performed are: # determine the location of the data in Auxiliary Storage . # determine the page frame in RAM to use as a container for the data. # write the existing page to Auxiliary Storage if it has been modified since it was last loaded. # load the requested data into the available page. The fault that triggers this operation is caused by a program trying to reference an address within a page that is not currently residing in RAM . OVERVIEW When a Page has to be loaded and all existing pages in RAM are currently in use, one of the existing pages must be swapped with the requested new page. The paging system must determine the page to swap by choosing one based on an algorithm that determines the best choice: the page least likely to be needed within a short time. Most operating systems use the Least Recently Used (LRU) page replacement algorithm. The theory behind LRU is that the least recently used page is the most likely one not to be needed shortly; when a new page is needed, the ''least recently used'' page is discarded. This algorithm is most often correct but not always: e.g. a sequential process moves forward through memory and never again accesses the most recently used page. The need to reference RAM at a particular address arises from two main sources: # Programs that are loading instructions to be executed. # Data being accessed by a program. Most programs that become active reach a steady state in their demand for memory locality both in terms of instructions fetched and data being accessed. This steady state is usually much less than the total memory required by the program. This steady state is sometimes referred to as the working set: the set of memory pages that are most frequently accessed. Virtual memory systems work most efficiently when the ratio of the working set to the total number of pages that can be stored in RAM is low enough to minimize the number of page faults. A misbehaving program or one that works with huge arrays that cross many pages will sometimes require a working set that is too large to be efficiently managed by the page system resulting in constant page faults that drastically slow down the system. This condition is referred to as Thrashing : a page is swapped out and then accessed causing frequent faults. An interesting characteristic of thrashing is that as the working set grows, there is very little increase in the number of faults until the ratio hits the critical point, at which point faults go up dramatically. If one graphs the number of faults on one axis and working set size on the other, the graph will look like a leftward pointing hockey stick. When "paging" is used as a verb, it refers to the process of moving pages to or from from the backing store, which is usually a local fixed disk. "Page in" generally refers to transferring a page from the backing store to RAM. Conversely, "page out" refers to transferring a page from RAM to the backing store. These words are normally used when talking about swapping, but also apply when files are pulled into or pushed out of Page Cache . SWAPPING The backing store for a Virtual Memory Operating System is typically many Magnitude s slower than RAM . Therefore it is desirable to reduce or eliminate paging, where practical. Some operating systems offer settings to influence the kernel's decisions about paging. # Linux offers the "/proc/sys/vm/swappiness" parameter, which changes the balance between paging out runtime memory, and dropping pages from the system page cache. # Windows 2000, XP, and Vista offer the DisablePagingExecutive registry setting, which controls whether user and kernel mode drivers, as well kernel mode OS code and data is eligible for paging out. 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. 1.5 times the installed RAM is a typical number. 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. SEE ALSO |
|
|