Operating System Concepts, Seventh Edition

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP 314 – Unit 3 Chapter 9 (Virtual Memory) Virtual memory is a technique that allows the execution of a process that is not completely in memory. Virtual memory abstracts main memory into an extremely large, uniform array of storage, separating logical memory as viewed by the user from physical memory. Background (315) The ability to execute a program that is only partially in memory would confer many benefits: A program would no longer be constrained by the amount of physical memory that is available. Because each user program could take less physical memory, more programs could be run at the same time, with a corresponding increase in CPU utilization and throughput but with no increase in response time or turnaround time. Less I/O would be need to load or swap each user program into memory, so each user program would run faster. Virtual memory involves the separation of logical memory as perceived by the users from physical memory. (317) The virtual address space of a process refers to the logical (or virtual) view of how a process is stored in memory. We allow the heap to grow upward in memory as it is used for dynamic memory allocation, and we allow the stack to grow downward through successive function calls. The large blank space (or hole) between the stack and the heap is part of the virtual address space, but will require actual physical pages only if the heap or stack grows. Virtual address spaces that include holes are known as sparse address spaces. Using a sparse address space is beneficial because the holes can be filled as the stack or heap segments grow, or if we wish to dynamically link libraries during program execution. Virtual memory also allows for processes to share files or memory through page sharing. (318) This leads to the following benefits: System libraries can be shared by several process through mapping of the shared object to virtual memory space. Similarly, virtual memory enables process to share memory. It can allow pages to be shared during process creation with the fork() system call, thus speeding up creation process. Demand Paging (319) One option for loading an executable program might be to load the entire binary into memory at execution time. However the problem with this is that you might not need the entire program in memory. An alternative strategy is known as demand paging and is commonly used in virtual memory systems. With demand-paged virtual memory, pages are only loaded when they are demanded during program execution; pages that are never accessed are thus never loaded into physical memory. A demand-paging system is similar to a paging system with swapping where processes reside in secondary memory.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ 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