Day 20 Virtual Memory.

Slides:



Advertisements
Similar presentations
Chapter 8 Virtual Memory
Advertisements

Operating Systems Prof. Navneet Goyal Department of Computer Science & Information Systems BITS, Pilani.
Segmentation and Paging Considerations
Day 20 Memory Management. Assumptions A process need not be stored as one contiguous block. The entire process must reside in main memory.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Virtual Memory Chapter 8.
Virtual Memory Chapter 8.
Modified from Silberschatz, Galvin and Gagne Lecture 16 Chapter 8: Main Memory.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
Memory Management 2010.
Virtual Memory Chapter 8.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Lecture 9: Virtual Memory Operating System I Spring 2007.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Virtual Memory Chapter 8.
Computer Organization and Architecture
Virtual Memory I Chapter 8.
Chapter 8 Virtual Memory
Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
VIRTUAL MEMORY. Virtual memory technique is used to extents the size of physical memory When a program does not completely fit into the main memory, it.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Virtual Memory Chapter 8. Characteristics of Paging and Segmentation A process may be broken up into pieces (pages or segments) that do not need to be.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 28 Fasih ur Rehman.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Silberschatz and Galvin  Operating System Concepts Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous.
Fall 2000M.B. Ibáñez Lecture 17 Paging Hardware Support.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Virtual Memory 1 1.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Informationsteknologi Wednesday, October 3, 2007Computer Systems/Operating Systems - Class 121 Today’s class Memory management Virtual memory.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Virtual Memory Chapter 8.
SLC/VER1.0/OS CONCEPTS/OCT'99
Chapter 2 Memory and process management
Day 21 Virtual Memory.
Chapter 8: Main Memory.
Day 22 Virtual Memory.
Day 19 Memory Management.
Chapter 8 Virtual Memory
Virtual Memory Chapter 8.
Lecture 10: Virtual Memory
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Operating System Concepts
O.S Lecture 13 Virtual Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Main Memory Session -15.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Module IV Memory Organization.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
So far… Text RO …. printf() RW link printf Linking, loading
Main Memory Background Swapping Contiguous Allocation Paging
Chapter 8: Memory Management strategies
2P13 Week 7.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Operating Systems Concepts
Operating Systems: Internals and Design Principles, 6/E
CSE 542: Operating Systems
Virtual Memory 1 1.
Presentation transcript:

Day 20 Virtual Memory

Assumptions An entire process resides in main memory. A process resides in main memory as one contiguous block. With the help of page tables/segment tables, a process can be split up into portions (page/segment).

Hardware allows us to place and then re-locate a process anywhere in memory. Also, hardware makes it possible to place the process portions in non-contiguous locations.

Assumption An entire process need not be held in memory. Portions of the process that are needed will be placed in memory. Portions are brought in as they are needed.

What happens when a new portion is needed? The resident set(i.e. the pieces of the program that currently reside in main memory) must consist of the first address to be accessed and the first data to be accessed. The first instruction’s execution takes place. Address translations are performed using the page/segment table. At some point, the instruction to be accessed or the data to be accessed will not be available in main memory. The hardware will issue an interrupt. The OS will take over. The current process will get blocked. The OS will issue a disk request on behalf of the process. When the disk read is complete, the block is moved from secondary memory to main memory and another interrupt is now issued by the disk indicating that the service has been performed. Process will be moved back to the Ready queue. When process gets scheduled to run, it will continue.

Advantages More processes in main memory. Better utilization of the processor. A process larger than main memory can also be run, with no intervention from the user. Only the size of secondary memory limits the user.

Real memory/Virtual memory Real memory – the main memory space. Virtual memory – the space perceived by the user includes secondary storage

Locality of reference Data and instruction references tend to cluster So, at any given time, only some part of the process has to reside in main memory.

Which block to replace when main memory is full? If incorrect decisions are made, then the blocks swapped out will have to be brought back again The OS will spend a large amount of time swapping blocks in and out of main memory – Thrashing Must make intelligent choices about which block to swap out to minimize thrashing.

Virtual memory works because: The OS can make intelligent guesses about which blocks must be swapped out. Hardware can keep track of which portions of a process are in main memory and also where they are in main memory.

Virtual memory with paging Page table per process. Page table entry includes present bit frame number modify bit flags for protection and sharing. Page tables can be huge an entry per page of the process large processes (larger than main memory). Page table itself is placed in virtual memory.

For a program to execute, the relevant portion of the page table and the starting instructions and data of the process must be present in main memory. A register holds the address of the page table in main memory.

Also in main memory Simple indexing

Two-level scheme to support large tables Consider a process as described here: Logical address space is 4-GiB (232 bytes) Size of a page is 4KiB (212 bytes) There are ___ pages in the process. This implies we need ____ page table entries. If each page table entry occupies 4-bytes, then need ______ byte large page table The page table will occupy __________ pages. Root table will consist of ____ entries – one for each page that holds part of the page table. Root table will occupy 212 bytes i.e 4KiB of space and will be kept in main memory permanently. A page access could require two disk accesses.