Chapter 2 - Memory Management, Early Systems Ivy Tech State College Northwest Region 01 CIS106 Microcomputer Operating Systems Gina Rue CIS Faculty.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Memory management In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. Memory management is achieved.
Chapter 2: Memory Management, Early Systems
Chapter 2: Memory Management, Early Systems
Memory Management, Early Systems
Understanding Operating Systems Fifth Edition
Memory Management Chapter 7.
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.
CS 311 – Lecture 21 Outline Memory management in UNIX
Chapter 9 – Real Memory Organization and Management
Memory Management Chapter 4. Memory hierarchy Programmers want a lot of fast, non- volatile memory But, here is what we have:
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
CS 104 Introduction to Computer Science and Graphics Problems
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.
1 Friday, June 30, 2006 "Man's mind, once stretched by a new idea, never regains its original dimensions." - Oliver Wendell Holmes, Jr.
Memory Management Chapter 5.
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
Silberschatz, Galvin and Gagne  Operating System Concepts Multistep Processing of a User Program User programs go through several steps before.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Understanding Operating Systems Sixth Edition
Chapter 2 Memory Management: Early Systems (all ancient history)
1 Lecture 8: Memory Mangement Operating System I Spring 2008.
Memory management. Instruction execution cycle Fetch instruction from main memory Decode instruction Fetch operands (if needed0 Execute instruction Store.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 32 Paging Read Ch. 9.4.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Swapping and Contiguous Memory Allocation. Multistep Processing of a User Program User programs go through several steps before being run. Program components.
Memory Management Chapter 7.
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
Chapter 7 Memory Management Seventh Edition William Stallings Operating Systems: Internals and Design Principles.
Chapter 10 Operating Systems.
Chapter 2 Memory Management: Early Systems Understanding Operating Systems, Fourth Edition.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Chapter 2 Memory Management: Early Systems Understanding Operating Systems, Fourth Edition.
Memory Management. Roadmap Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management –Paging –Segmentation.
Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Virtual Memory Prof. Sin-Min Lee Department of Computer Science.
Memory Management. Introduction To improve both the utilization of the CPU and the speed of its response to users, the computer must keep several processes.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
2010INT Operating Systems, School of Information Technology, Griffith University – Gold Coast Copyright © William Stallings /2 Memory Management.
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.
Memory management.
Memory Allocation The main memory must accommodate both:
Chapter 9 – Real Memory Organization and Management
Main Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Multistep Processing of a User Program
Memory management Igor Radovanović.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Memory Management: Early System.
So far… Text RO …. printf() RW link printf Linking, loading
Chapter 8: Memory management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Presentation transcript:

Chapter 2 - Memory Management, Early Systems Ivy Tech State College Northwest Region 01 CIS106 Microcomputer Operating Systems Gina Rue CIS Faculty

2 Memory Manager Four types of memory allocation schemes single-user systemssingle-user systems fixed partitionsfixed partitions dynamic partitionsdynamic partitions re-locatable dynamic partitionsre-locatable dynamic partitions

3 Memory Manager Memory performance is dependent on two things:Memory performance is dependent on two things: –how much memory is available –how it is optimized while jobs are being processed

See Single User Algorithm p.184 Single-user Contiguous Scheme First memory allocation scheme early computers had limited memoryearly computers had limited memory allocated as much contiguous spaceallocated as much contiguous space –if the job was too large, it couldn’t execute jobs processed sequentiallyjobs processed sequentially –OS algorithm used to allocate memory did not support multiprogrammingdid not support multiprogramming

See Table & Fig. 2.1 p.205 Fixed-Partitions First attempt to allow for multiprogrammingFirst attempt to allow for multiprogramming created within main memory - one partition for each jobcreated within main memory - one partition for each job to protect job’s memory space criticalto protect job’s memory space critical –algorithm used to store jobs in memory, size of job must match size of partition –major drawback: internal fragmentation is unused space within the fixed partition

See Fig. 2.2 p.226 Dynamic Partitions available memory kept in contiguous blocksavailable memory kept in contiguous blocks jobs are given only as much memory as they request when loaded for processingjobs are given only as much memory as they request when loaded for processing first-come first-served priority basisfirst-come first-served priority basis –subsequent allocation of memory creates fragments –called external fragmentation, free memory blocks between allocated memory

7 Best-Fit vs First-Fit Allocation New jobs come into the system, the free partitions must be allocated first-fitfirst-fit first partition fitting the requirement, low to high order memory list best-fitbest-fit closest fit, smallest partition fitting the requirements, smallest to largest memory list For both schemes, memory manager keeps lists of free & used partitions (free/busy) by size or location See Table 2.2 & 2.3 p.24

8 Best-Fit vs First-Fit Allocation Which is best? For many years, no answerFor many years, no answer best-fit resulted in a better “fit”, it also resulted in smaller “free” space (sliver)best-fit resulted in a better “fit”, it also resulted in smaller “free” space (sliver) In recent years, access times have improved so that the scheme that saves more resources & memory space is the best choiceIn recent years, access times have improved so that the scheme that saves more resources & memory space is the best choice Research continues to find the optimum allocation schemeResearch continues to find the optimum allocation scheme

9 Deallocation Deallocation Memory space must be released fixed partitions - when a job is complete, the memory manager resets status of memory block where the job was stored to “free”fixed partitions - when a job is complete, the memory manager resets status of memory block where the job was stored to “free” dynamic partitions - more complex algorithm tries to combine free areas of memory wherever possibledynamic partitions - more complex algorithm tries to combine free areas of memory wherever possible 3 alternative situations systems must prepare for deallocation –block is adjacent to another free block –block is between two free blocks –block is isolated from other free blocks

10 Relocatable Dynamic Partitions Both fixed & dynamic leave “slivers” of memory left over Solution - Memory Manager relocates programs to gather together all empty blocks & compact them into one large enough to accommodate jobs waiting compaction - every program in memory must be relocated so they are contiguous

11 Relocatable Dynamic Partitions What goes on behind the scenes when relocation and compaction take place? What keeps track of how far each job has moved from its original location? Special-purpose registers are used to help with relocationSpecial-purpose registers are used to help with relocation bound register-stores highest or lowest location in memory accessible by each programbound register-stores highest or lowest location in memory accessible by each program relocation register-contains the value that must be added to each address referenced in the programrelocation register-contains the value that must be added to each address referenced in the program

12 Relocatable Dynamic Partitions What lists have to be updated? After relocation & compaction, both free lists and busy lists are updatedAfter relocation & compaction, both free lists and busy lists are updated Each job will have a new address except for those that already reside in the lowest memory locationsEach job will have a new address except for those that already reside in the lowest memory locations

13 Relocatable Dynamic Partitions In effect, by compacting & relocating, by compacting & relocating, the Memory Manager optimizes the use of memory thus improves throughput -- one of the measures of the system performance. The crucial factor is the timing of the compaction….

14 Relocatable Dynamic Partitions Compaction - when & how often should it be done? –When a certain % of memory becomes busy, 75 percent –Only when there are jobs waiting to get in – After a prescribed amount of time The best choice depends on the job mix to optimize both processing time & memory use while keeping overhead low

15 Summary 4 memory management techniques4 memory management techniques – single-user, fixed partitions, dynamic partitions, relocatable partitions –all 4 require that the entire program loaded into memoryloaded into memory be stored contiguouslybe stored contiguously remain in memory until the job is completedremain in memory until the job is completed

16 Summary 4 memory management techniques (schemes)4 memory management techniques (schemes) – sufficient for first 3 generations of computers which processed jobs in batch mode –turnaround time was delayed to hours or even days between job submission and completion