COMP 314 - U3C9

Operating System Concepts, Seventh Edition

Info iconThis 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.
Background image of page 1

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

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

This note was uploaded on 07/18/2011 for the course COMP 314 taught by Professor Dr.dunwei(grant)wen during the Spring '11 term at Open Uni..

Page1 / 9

COMP 314 - U3C9 - COMP 314 Unit 3 Chapter 9 (Virtual...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online