COMP 3500 Introduction to Operating Systems Memory Management: Part 2 Dr. Xiao Qin Auburn University Slides.

Slides:



Advertisements
Similar presentations
Memory Management Chapter 7.
Advertisements

Fixed/Variable Partitioning
Memory Management Chapter 7. Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as.
Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable supply of ready processes to.
Allocating Memory.
Chapter 7 Memory Management
Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2009, Prentice.
Day 20 Memory Management. Assumptions A process need not be stored as one contiguous block. The entire process must reside in main memory.
OS Fall’02 Memory Management Operating Systems Fall 2002.
Chapter 7 Memory Management
Memory Management Chapter 7. Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as.
Memory Management.
Memory Management Chapter 7 B.Ramamurthy. Memory Management Subdividing memory to accommodate multiple processes Memory needs to allocated efficiently.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management Chapter 5.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Chapter 7 Memory Management
1 Lecture 8: Memory Mangement Operating System I Spring 2008.
1 Memory Management Chapter 7. 2 Roadmap n Memory management u Objectives u Requirements n Simple memory management u Memory partitioning F Fixed partitioning.
Chapter 7 Memory Management Seventh Edition William Stallings Operating Systems: Internals and Design Principles.
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.
Example of a Resource Allocation Graph CS1252-OPERATING SYSTEM UNIT III1.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 32 Paging Read Ch. 9.4.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Operating System 7 MEMORY MANAGEMENT. MEMORY MANAGEMENT REQUIREMENTS.
Memory Management Chapter 7.
Chapter 7 Memory Management Seventh Edition William Stallings Operating Systems: Internals and Design Principles.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Dr.
Chapter 7 Memory Management
Chapter 7 Memory Management Seventh Edition William Stallings Operating Systems: Internals and Design Principles.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Memory Management Chapter 7.
Memory Management. Roadmap Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management –Paging –Segmentation.
Subject: Operating System.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
1 Memory Management Chapter 8. 2 Memory Management n It is the task carried out by the OS and hardware to accommodate multiple processes in main memory.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
Informationsteknologi Wednesday, October 3, 2007Computer Systems/Operating Systems - Class 121 Today’s class Memory management Virtual memory.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo 1 Memory management & paging.
Memory management Ref: Stallings G.Anuradha. What is memory management? The task of subdivision of user portion of memory to accommodate multiple processes.
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.
CSNB224 – AAG 2007 Memory Management Chapter 7. CSNB224 – AAG 2007 Memory Management In uniprogramming system, memory is divided into two parts: for the.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
Memory Management Chapter 5 Advanced Operating System.
1 Memory Management n In most schemes, the kernel occupies some fixed portion of main memory and the rest is shared by multiple processes.
2010INT Operating Systems, School of Information Technology, Griffith University – Gold Coast Copyright © William Stallings /2 Memory Management.
COMP 3500 Introduction to Operating Systems Memory Management: Part 1 Dr. Xiao Qin Auburn University Slides.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
COMP 3500 Introduction to Operating Systems Paging: Basic Method Dr. Xiao Qin Auburn University Slides.
MEMORY MANAGEMENT. memory management  In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. 
Memory Management Chapter 7.
Chapter 7 Memory Management
Memory Management Chapter 7.
Memory Management.
ITEC 202 Operating Systems
Day 19 Memory Management.
Chapter 8 Main Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Memory Management Chapter 7.
Lecture 3: Main Memory.
Operating System Chapter 7. Memory Management
Operating Systems: Internals and Design Principles, 6/E
Chapter 7 Memory Management
Presentation transcript:

COMP 3500 Introduction to Operating Systems Memory Management: Part 2 Dr. Xiao Qin Auburn University Slides are adopted and modified from Drs. Stallings, Silberschatz, Galvin, Gagne, Nutt

Ex1: Fixed Partitioning 2 Which design will you choose to implement? Why? Wasted Memory? Overall Performance?

Disadvantages of Fix Partitioning The number of partitions specified at system generation time limits the number of active processes in the system Small jobs will not efficiently utilize partition space 3

Dynamic Partitioning Partitions are of variable length and number Process is allocated exactly as much memory as it requires This technique was used by IBM’s mainframe operating system, OS/MVT 4

5 Ex2: What is a problem with dynamic partitioning?Small holes.

Q1: What is a solution to the fragmentation problem? memory becomes more and more fragmented memory utilization declines External Fragmentation technique for overcoming external fragmentation OS shifts processes so that they are contiguous free memory is together in one block time consuming and wastes CPU time (Why?) Compaction 6

Placement Algorithms Best-fit chooses the block that is closest in size to the request First-fit begins to scan memory from the beginning and chooses the first available block that is large enough Next-fit begins to scan memory from the location of the last placement and chooses the next available block that is large enough 7

8 Ex3: Which slot do Best-Fit, First-Fit, and Next-Fit allocate for 16-MB block?

Buddy System Comprised of fixed and dynamic partitioning schemes Space available for allocation is treated as a single block Memory blocks are available of size 2 K words, L ≤ K ≤ U, where o 2 L = smallest size block that is allocated o 2 U = largest size block that is allocated; generally 2 U is the size of the entire memory available for allocation 9

10

11

Addresses reference to a memory location independent of the current assignment of data to memory Logical address is expressed as a location relative to some known point Relative actual location in main memory Physical or Absolute 12

13

Paging Partition memory into equal fixed-size chunks that are relatively small Process is also divided into small fixed-size chunks of the same size Pages chunks of a process Frames available chunks of memory 14

15

Page Table Maintained by operating system for each process Contains the frame location for each page in the process Processor must know how to access for the current process Used by processor to produce a physical address 16

17 Ex4: Page Table: An time (f)

18

19 Examples of Logical-to-Physical Address Translation

Segmentation A program can be subdivided into segments o may vary in length o there is a maximum length Addressing consists of two parts: o segment number o an offset Similar to dynamic partitioning Eliminates internal fragmentation 20

Segmentation Usually visible Provided as a convenience for organizing programs and data Typically the programmer will assign programs and data to different segments For purposes of modular programming the program or data may be further broken down into multiple segments – Question: Why the programmer must be aware of the maximum segment size limitation? 21

Address Translation Another consequence of unequal size segments is that there is no simple relationship between logical addresses and physical addresses The following steps are needed for address translation: Extract the segment number as the leftmost n bits of the logical address Use the segment number as an index into the process segment table to find the starting physical address of the segment Compare the offset, expressed in the rightmost m bits, to the length of the segment. If the offset is greater than or equal to the length, the address is invalid The desired physical address is the sum of the starting physical address of the segment plus the offset 22

Examples of Logical-to-Physical Address Translation 23

Summary Dynamic Partitioning Buddy System Logical-to-Physical Address Translation Segmentation 24