Partitions main memory into individually managed page

This preview shows page 21 - 25 out of 26 pages.

partitions main memory into individually managed page frames , that are written (or paged) to disk when they are not immediately needed 41 Virtual Memory A physical address is the actual memory address of physical memory Programs create virtual addresses that are mapped to physical addresses by the memory manager Page faults occur when a logical address requires that a page be brought in from disk Memory fragmentation occurs when the paging process results in the creation of small, unusable clusters of memory addresses 42
Image of page 21

Subscribe to view the full document.

2/23/2012 22 Virtual Memory and Pages Main memory and virtual memory are divided into equal sized pages Most applications do not require everything in memory at once Some parts can be paged to disk Pages allocated to a process do not need to be stored contiguously On disk or in memory Only the needed pages are placed in memory at any given time The unused pages are in slower virtual memory Modern O/S and Apps page even if there is enough memory for everything to fit 43 Page Table Information concerning the location of each page, whether on disk or in memory, is maintained in a data structure called a page table (shown below) There is one page table for each active process 44
Image of page 22
2/23/2012 23 Virtual Memory When a process generates a virtual address, the operating system translates it into a physical memory address The virtual address is divided into two fields: A page field, and an offset field The page field determines the page location of the address and the offset indicates the location of the address within the page The logical page number is translated into a physical page frame through a lookup in the page table 45 Virtual Memory If the page is not in memory and (must be fetched from disk) the valid bit in the page table is zero for the logical address A page fault The page is retrieved from virtual memory and placed into main memory The valid bit in the page table is set to 1 If there is no available memory, a page is evicted from main memory and sent to virtual memory If the valid bit is 1, the virtual page number is replaced by the physical frame number The data is then accessed by adding the offset to the physical frame number 46
Image of page 23

Subscribe to view the full document.

2/23/2012 24 Virtual Memory Segmentation Instead of dividing memory into equal-sized pages, virtual address space is divided into variable-length segments Often under the control of the programmer A segment is located through its entry in a segment table Contains the segment’s memory location and a bounds limit that indicates its size After a page fault, the operating system searches for a location in memory large enough to hold the segment that is retrieved from virtual memory 47 Memory Fragmentation Both paging and segmentation can cause fragmentation Paging is subject to internal fragmentation because a process may not need the entire range of addresses contained within the page There may be many pages containing unused fragments of memory.
Image of page 24
Image of page 25
You've reached the end of this preview.
  • Fall '09
  • Hansen
  • Virtual memory, CPU cache, Cache algorithms, main memory

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern