50
Chapter 4. Physical and Virtual Memory
Writing modified pages to a dedicated area on a mass storage device (usually known as swapping
or paging space)
Marking unmodified pages as being free (there is no need to write these pages out to disk as they
have not changed)
In order to determine appropriate working sets for all processes, the operating system must track
usage information for all pages. In this way, the operating system can determine which pages are
being actively used (and must remain memory resident) and which pages are not (and therefore, can
be removed from memory). In most cases, some sort of least recently used algorithm determines
which pages are eligible for removal from process working sets.
4.4.3. Swapping
While swapping (writing modified pages out to the system swap space) is a normal part of a sys
tem's operation, it is possible to experience too much swapping. The reason to be wary of excessive
swapping is that the following situation can easily occur, over and over again:
Pages from a process are swapped
The process becomes runnable and attempts to access a swapped page
The page is faulted back into memory (most likely forcing some other processes' pages to be
swapped out)
A short time later, the page is swapped out again
If this sequence of events is widespread, it is known as thrashing and is indicative of insufficient
RAM for the present workload. Thrashing is extremely detrimental to system performance, as the
CPU and I/O loads that can be generated in such a situation can quickly outweigh the load imposed
by a system's real work. In extreme cases, the system may actually do no useful work, spending all its
resources moving pages to and from memory.
4.5. Virtual Memory Performance Implications
While virtual memory makes it possible for computers to more easily handle larger and more complex
applications, as with any powerful tool, it comes at a price. The price in this case is one of performance
a virtual memory operating system has a lot more to do than an operating system that is not capable
of virtual memory. This means that performance is never as good with virtual memory as it is when
the same application is 100% memory resident.
However, this is no reason to throw up one's hands and give up. The benefits of virtual memory are too
great to do that. And, with a bit of effort, good performance is possible. The thing that must be done
is to look at the system resources that are impacted by heavy use of the virtual memory subsystem.
4.5.1. Worst Case Performance Scenario
For a moment, take what you have read in this chapter and consider what system resources are used
by extremely heavy page fault and swapping activity:
RAM It stands to reason that available RAM is low (otherwise there would be no need to page
fault or swap).
Disk While disk space would not be impacted, I/O bandwidth (due to heavy paging and swap
ping) would be.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved