In a system using virtual memory, the physical memory is divided into equally-sized pages. The memory addressed by a process is also divided into logical pages of the same size. When a process references a memory address, the memory manager fetches from disk the page that includes the referenced address, and places it in a vacant physical page in the RAM. Subsequent references within that logical page are routed to the physical page. When the process references an address from another logical page, it too is fetched into a vacant physical page and becomes the target of subsequent similar references.
If the system does not have a free physical page, the memory manager swaps out a logical page into the swap area - usually a paging file on disk (in Windows
XP: pagefile.sys), and copies (swaps in) the requested logical page into the now-vacant physical page. The page swapped out may belong to a different process. There are many strategies for choosing which page is to be swapped out. (One is LRU: the Least Recently Used page is swapped out.) If a page is swapped out and then is referenced, it is swapped back in, from the swap area, at the expense of another page.
Virtual memory enables each process to act as if it has the whole memory space to itself, since the addresses that it uses to reference memory are translated by the virtual memory mechanism into different addresses in physical memory. This allows different processes to use the same memory addresses - the memory manager will translate references to the same memory address by two different processes into different physical addresses. One process generally has no way of accessing the memory of another process. A process may use an address space larger than the available physical memory, and each reference to an address will be translated into an existing physical address. The bound on the amount of memory that a process may actually address is the size of the swap area, which may be smaller than the addressable space. (A process can have an address space of 4GB yet actually use only 2GB, and this can run on a machine with a pagefile of 2GB.)
The size of the virtual memory on a system is smaller than the sum of the physical RAM and the swap area, since pages that are swapped in are not erased from the swap area, and so take up two pages of the sum of sizes.
Usually under Windows, the size of the swap area is 1.5 times the size of the RAM.
The virtual memory manager might issue the message:
"Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file." This happens if it is required to swap out a page from RAM to the pagefile while all pages in the pagefile are already taken. With that message, it will allocate more space to the pagefile and use the added space to store the newly- swapped-out page (and subsequent pages).
One case that might cause the system to want to enlarge the pagefile is that too many processes are running. In this case, only relatively little of each process' memory can fit in the RAM, and relatively many pages reside in the pagefile. In this case, the virtual memory system is required to hold too many pages - a "small" number of pages per process times "many" processes. In such a case it is also likely that the system will run slowly, since pages need to be swapped in and out more frequently.
Another case that might cause the system to want to enlarge the pagefile is that a process has a memory leak. There, the process is occupying a lot of unused memory, which will likely be swapped away in the pagefile and never be swapped in.
The usage of the pagefile in Windows can be seen in the Task Manager by checking the Virtual Memory Size box after View, Select Columns.
You May Also Find These Documents Helpful
-
that is to keep the slowdown due to paging to a reasonable level, we can allow only less than one memory access out 2,500,000 to page fault. in a demand paging system keep the page…
- 359 Words
- 2 Pages
Good Essays -
The operating system occupies low memory, starting with memory address 0. Directly afterwards is system control information, then the various resident operating system…
- 7085 Words
- 29 Pages
Good Essays -
1. Why is virtual memory addresses used for applications? – So it can have its own address space on the memory.…
- 239 Words
- 2 Pages
Satisfactory Essays -
RAM is the random access memory and it is volatile. It holds program instructions and data. The CPU can find…
- 204 Words
- 1 Page
Satisfactory Essays -
memory changes on how it is set. It either can be added or reduced from the computer.…
- 281 Words
- 2 Pages
Satisfactory Essays -
Page files are used when the CPU runs out of physical memory. The disadvantage of this is that ________…
- 1635 Words
- 16 Pages
Good Essays -
For server (web) performance. Swap space is an area on a disk that temporarily holds a process memory image. When physical memory demand is sufficiently low, process memory images are brought back into physical…
- 822 Words
- 4 Pages
Good Essays -
Pointers are, essentially, address variables, or variables that hold as their value the address of other variables. In terms of memory management, they are very powerful devices, and they more closely and efficiently use the actual internal hardware registers of the microprocessor that the program operates on.…
- 1463 Words
- 6 Pages
Good Essays -
There are several items that are pertinent to memory management such as, basic hardware, the binding of symbolic memory addresses to definite physical addresses and the difference between logical and physical addresses. The most important task that memory management executes is the distribution and collection of memory…
- 574 Words
- 2 Pages
Satisfactory Essays -
There are two types of memory which we need and use on our computers one of them is RAM and the other one is cache.…
- 944 Words
- 4 Pages
Good Essays -
Random-access-memory (RAM) is a very important specification of the computer. By ensuring you have enough RAM, the faster your system processes, you can store more data, and allow more programs to run at the same time. As the OS allows the different task to complete for the processor, the RAM is used as temp storage, when the processor no longer needs them the OS clears it. Virtual memory is the hard drive space borrowed to use if there isn’t enough…
- 580 Words
- 3 Pages
Good Essays -
Virtualization allows multiple operating system instances to run concurrently on a single computer; it is a means of separating hardware from a single operating system. Each “guest” OS is managed by a Virtual Machine Monitor (VMM), also known as a hypervisor. Because the virtualization system sits between the guest and the hardware, it can control the guests’ use of CPU, memory, and storage, even allowing a guest OS to migrate from one machine to another.…
- 1395 Words
- 6 Pages
Good Essays -
Sharing allows several processes to access the same portion of main memory (Stallings, 2012). When there are a number of processes executing the same program it is beneficial to allow each process to access the same copy of the program rather than have its own separate copy (Stallings, 2012,). The memory management system must therefore…
- 573 Words
- 3 Pages
Good Essays -
For any operating system to function properly, one of the vital tasks it must be able to do is manage memory. When a program runs on a computer, it first must be loaded into memory before it can execute. There are five different requirements memory management must satisfy in order to execute the program so it runs without errors or corruption. These requirements are relocation, protection, sharing, logical organization, and physical organization.…
- 730 Words
- 3 Pages
Good Essays -
Sharing occurs when many different process need to access same areas of the main memory at the same time. Memory management allows this to be done without compromising the integrity of any of the data.…
- 392 Words
- 2 Pages
Good Essays