9.9.2 Memory Placement Strategies Where to put incoming processes –First-fit strategy Process placed in first hole of sufficient size found Simple, low.

Slides:



Advertisements
Similar presentations
Multilevel Page Tables
Advertisements

Memory.
Part IV: Memory Management
Allocating Memory.
CS 311 – Lecture 21 Outline Memory management in UNIX
CS 153 Design of Operating Systems Spring 2015
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Modified from Silberschatz, Galvin and Gagne Lecture 16 Chapter 8: Main Memory.
Chapter 10 – Virtual Memory Organization Outline 10.1 Introduction 10.2Virtual Memory: Basic Concepts 10.3Block Mapping 10.4Paging Paging Address.
Chapter 9 – Real Memory Organization and Management
1 Lecture 9: Virtual Memory Operating System I Spring 2007.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
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.
Chapter 7: Main Memory CS 170, Fall Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Memory Management Five Requirements for Memory Management to satisfy: –Relocation Users generally don’t know where they will be placed in main memory May.
Virtual Memory I Chapter 8.
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.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
Multilevel Page Tables Multilevel page tables –System can store in discontiguous locations in main memory those portions of process’s page table.
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.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
Memory Management -1 Background Swapping Memory Management Schemes
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 32 Paging Read Ch. 9.4.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Chapter 10 Memory Management Part_1. 2 Overview Basic Concepts The major tasks of the memory manger are the allocation and deallocation of main memory.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Memory Management 1 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Page 1 2P13 Week 5. Page 2 Page 3 Page 4 Page 5.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Silberschatz and Galvin  Operating System Concepts Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous.
CE Operating Systems Lecture 14 Memory management.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Memory Management Operating Systems CS550. Memory Manager Memory manager - manages allocation and de-allocation of main memory Plays significant impact.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
Operating Systems Unit 7: – Virtual Memory organization Operating Systems.
Memory Management. Why memory management? n Processes need to be loaded in memory to execute n Multiprogramming n The task of subdividing the user area.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo 1 Memory management & paging.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
CHAPTER 3-3: PAGE MAPPING MEMORY MANAGEMENT. VIRTUAL MEMORY Key Idea Disassociate addresses referenced in a running process from addresses available in.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Memory and Addressing It all starts.
Operating Systems Session 7: – Virtual Memory organization Operating Systems.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Memory.
Memory Management Chapter 5 Advanced Operating System.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 8: 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.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
Memory Management Virtual Memory.
Memory COMPUTER ARCHITECTURE
Chapter 8: Main Memory.
CSE 120 Principles of Operating
Chapter 9 – Real Memory Organization and Management
Main Memory Management
Chapter 8: Main Memory.
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
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.
Unit 6: Real Memory organization management
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 3: Main Memory.
Contents Memory types & memory hierarchy Virtual memory (VM)
Operating Systems Concepts
Presentation transcript:

9.9.2 Memory Placement Strategies Where to put incoming processes –First-fit strategy Process placed in first hole of sufficient size found Simple, low execution-time overhead –Best-fit strategy Process placed in hole that leaves least unused space around it More execution-time overhead –Worst-fit strategy Process placed in hole that leaves most unused space around it Leaves another large hole, making it more likely that another process can fit in the hole

9.10 Multiprogramming with Memory Swapping Not necessary to keep inactive processes in memory –Swapping Only put currently running process in main memory –Others temporarily moved to secondary storage –Maximizes available memory –Significant overhead when switching processes Better yet: keep several processes in memory at once –Less available memory –Much faster response times –Similar to paging

Figure 9.17 Multiprogramming in a swapping system in which only a single process at a time is in main memory Multiprogramming with Memory Swapping

Chapter 10 – Virtual Memory Organization Outline 10.1 Introduction 10.2Virtual Memory: Basic Concepts 10.3Block Mapping 10.4Paging Paging Address Translation by Direct Mapping Paging Address Translation by Associative Mapping Paging Address Translation with Direct/Associative Mapping Multilevel Page Tables Inverted Page Tables Sharing in a Paging System 10.5Segmentation Segmentation Address Translation by Direct Mapping Sharing in a Segmentation System Protection and Access Control in Segmentation Systems 10.6Segmentation/Paging Systems Dynamic Address Translation in a Segmentation/Paging System Sharing and Protection in a Segmentation/Paging System 10.7Case Study: IA-32 Intel Architecture Virtual Memory

Objectives After reading this chapter, you should understand: –the concept of virtual memory. –paged virtual memory systems. –segmented virtual memory systems. –combined segmentation/paging virtual memory systems. –sharing and protection in virtual memory systems. –the hardware that makes virtual memory systems feasible. –the IA-32 Intel architecture virtual memory implementation.

10.1 Introduction Virtual memory –Solves problem of limited memory space –Creates the illusion that more memory exists than is available in system –Two types of addresses in virtual memory systems Virtual addresses –Referenced by processes Physical addresses –Describes locations in main memory –Memory management unit (MMU) Translates virtual addresses to physical address

Figure 10.1 Evolution of memory organizations Introduction

10.2 Virtual Memory: Basic Concepts Virtual address space, V –Range of virtual addresses that a process may reference Real address space, R –Range of physical addresses available on a particular computer system Dynamic address translation (DAT) mechanism –Converts virtual addresses to physical addresses during program execution

Figure 10.3 Pieces of address spaces exist in memory and in virtual storage Virtual Memory: Basic Concepts Q: What does OS do in this picture? Q: |V| >> |R|?

10.3 Block Mapping Two contiguous instructions In V? In R? Figure 10.5 Artificial contiguity.

10.3 Block Mapping Pages –Blocks are fixed size –Technique is called paging Segments –Blocks maybe of different size –Technique is called segmentation Block mapping –System represents addresses as ordered pairs Figure 10.6 Virtual address format in a block mapping system.

Figure 10.7 Virtual address translation with block mapping Block Mapping

10.4 Paging Paging uses fixed-size block mapping –Virtual address in paging system is an ordered pair v = (p, d) p is the number of the page in virtual memory on which the referenced item resides d is the displacement from the start of page p at which the referenced item is located Figure 10.8 Virtual address format in a pure paging system.

Figure 10.9 Main memory divided into page frames Paging Page frame –Fixed-size block of main memory –Begins at a main memory address that is an integral multiple of fixed page size (ps)

Figure Correspondence between virtual memory addresses and physical memory addresses in a pure paging system Paging Q: What is the significance of dividing the VM and MEM into equal-sized pages?

10.4 Paging Page table entry (PTE) –Indicates that virtual page p corresponds to page frame p´ –Contains a resident bit to indicate if page is in memory If so, PTE stores the page’s frame number Otherwise, PTE stores the location of the page on secondary storage Figure Page table entry.

Paging Address Translation by Direct Mapping Direct mapping –Dynamic address translation under paging is similar to block address translation –Process references virtual address v = (p, d) DAT adds the process’s page table base address, b, to referenced page number, p b + p forms the main memory address of the PTE for page p System concatenates p´ with displacement, d, to form real address, r

Figure Paging address translation by direct mapping Paging Address Translation by Direct Mapping

Page # Offset/displacement Virtual address Page table Q1. What is the difference between swapping and paging? Q2. Suppose that the secondary storage compartment is not listed in the page table here. What is the physical address? Group Discussion 9 - 4/2/09