You are on page 1of 5

Virtual Memory Virtual Memory is a feature available on most modern computer to provide ‘additional memory’ for the computer

, especially when the RAM is insufficient to run a program. Virtual Memory combines the RAM with some spaces on the hard drive. When the RAM is running low, some memory from the RAM is moved into the special space on the hard drive called paging file. Then RAM will be freed up so the currently running program can be finished first. However, reading from paging file took more time than reading from RAM, so generally it’s still better to increase the RAM size instead of paging file for the long run. To accomplish the paging file operation, a MMU or Memory Management Unit is needed. Here is a diagram explaining more about MMU:

So first, the CPU sends the virtual addresses needed into the MMU. Later, the MMU sends the physical addresses to the memory to be processed.

. (b) Pictured above: (a) illustrates the 32 bit addresses with two page table fields.Pictured above: a detailed illustration about the internal operation of an MMU with 16 4Kb pages. (b) illustrates the two-level page tables.

Modified page must be first saved. The following paragraphs will discuss about page replacements. page faults forces choices -the algorithm must choose which page must be removed and make room for the incoming page.Pictured above: an illustration of a typical page table entry Above: a table about TLBs / Translation Lookaside Buffers to speed up paging. The algorithms for page replacements works as follows. while the unmodified page can be . Pictured above: a comparison between a traditional page table with an inverted page table.

    not referenced. modified NRU will remove page at random. The page at the beginning of the list is then replaced. it is better not using an often used page. Pictured above: The Second-Chance Page Replacement Algorithm. because it might be needed soon. modified referenced. each page has reference bit. For the Optimal Page Replacement Algorithm. A has R bit set (numbers above pages are loading times). Pages are classified as follows. estimation can be done to the nearest possible farthest point by logging page use on previous runs of processes. but then page list if fault occurs at time 20. . even though this is also impractical. it maintains a linked list of all pages. For the Not Recently Used Page Replacement Algorithms. However. The pages are sorted in FIFO order. The disadvantages of this kind of algorithm. modified bit that are set when the page is referenced or modified. To replace a page. For the FIFO/First-In-First-Out Page Replacement Algorithm. in the order they came into the memory. but it is impossible. from lowest numbered non-empty class. not modified not referenced. is that page in memory the longest might be the most often used. not modified referenced. however.just overwritten. the replacement should be the page needed at the farthest point in the future.

Pictured above: The Clock Page Replacement Algorithm. .