1 Chapter 3.1 : Memory Management Storage hierarchy Storage hierarchy Important memory terms Important memory terms Earlier memory allocation schemes Earlier.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Part IV: Memory Management
Chapter 6: Memory Management
Allocating Memory.
1 CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania, Fall 2002 Lecture Note: Memory Management.
Memory Management Chapter 4. Memory hierarchy Programmers want a lot of fast, non- volatile memory But, here is what we have:
Memory Management Chapter 7. Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as.
CSCI2413 Lecture 5 Operating Systems Memory Management 1 phones off (please)
Chapter 3.1 : Memory Management
Memory Management Chapter 5.
Chapter 7 Memory Management
Memory Allocation CS Introduction to Operating Systems.
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally MEMORYMANAGEMNT.
Memory Management Chapter 7.
Dynamic Partition Allocation Allocate memory depending on requirements Partitions adjust depending on memory size Requires relocatable code –Works best.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
1 Memory Management (a). 2 Background  Program must be brought into memory and placed within a process for it to be run.  Input queue – collection of.
1. Memory Manager 2 Memory Management In an environment that supports dynamic memory allocation, the memory manager must keep a record of the usage of.
Ch. 4 Memory Mangement Parkinson’s law: “Programs expand to fill the memory available to hold them.”
1 Memory Management Chapter Basic memory management 4.2 Swapping (εναλλαγή) 4.3 Virtual memory (εικονική/ιδεατή μνήμη) 4.4 Page replacement algorithms.
CY2003 Computer Systems Lecture 09 Memory Management.
Chapter 4 Memory Management.
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.
Subject: Operating System.
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.
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
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
Memory Management Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only storage.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Memory.
CHAPTER 3-1, 3-2 MEMORY MANAGEMENT. MEMORY HIERARCHY Small amount of expensive, fast, volatile cache Larger amount of still fast, but slower, volatile.
Memory Management Chapter 5 Advanced Operating System.
Ch. 4 Memory Mangement Parkinson’s law: “Programs expand to fill the memory available to hold them.”
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Memory Management One of the most important OS jobs.
Memory Management Chapter 7.
Chapter 2 Memory and process management
Day 19 Memory Management.
Day 19 Memory Management.
From Monoprogramming to multiprogramming with swapping
Chapter 8: Main Memory.
Memory Allocation The main memory must accommodate both:
CSC 322 Operating Systems Concepts Lecture - 12: by
Day 18 Memory Management.
Main Memory Management
Module IV Memory Organization.
Chapter 8: Main Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
CS Introduction to Operating Systems
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 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
Memory Management-I 1.
Chapter3 Memory Management Techniques
Main Memory Background Swapping Contiguous Allocation Paging
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Lecture 3: Main Memory.
Operating System Chapter 7. Memory Management
Memory Management (1).
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
COMP755 Advanced Operating Systems
Page Main Memory.
Presentation transcript:

1 Chapter 3.1 : Memory Management Storage hierarchy Storage hierarchy Important memory terms Important memory terms Earlier memory allocation schemes Earlier memory allocation schemes Contiguous memory allocation Contiguous memory allocation Fixed partitions Fixed partitions Dynamic partitions Dynamic partitions Managing free & allocated Memory Space Managing free & allocated Memory Space

2 Storage Hierarchy Main Memory Cache on Chip (internal cache) External Cache memory RAM Secondary Storage Hard Disk Tertiary Storage CD ROM Floppy Tape Access time decreases Capacity decreases Cost increases

3 Important Memory Terms

4 Contiguous Memory Allocation After loading OS, the rest of the memory is available for user program After loading OS, the rest of the memory is available for user program Size of user program is fixed by available memory Size of user program is fixed by available memory Use of overlays for larger programs Use of overlays for larger programs OS & drivers User Program

5 Dos Memory Layout

6 Basic Memory Management ( Monoprogramming) Three simple ways of organizing memory - an operating system with one user process

7 Multiprogramming with Fixed Partitions Partition numbers and sizes (equal or unequal) are set by operator at system start up based on workload statistics Partition numbers and sizes (equal or unequal) are set by operator at system start up based on workload statistics Used by IBM’s MFT (Multiprogramming with a Fixed Number of Tasks) OS for IBM 360 systems long time ago Used by IBM’s MFT (Multiprogramming with a Fixed Number of Tasks) OS for IBM 360 systems long time ago OS Partition 1Partition 2Partition 3 Process 1 Process 2 Process 3 F r a g m e n t F r a g m e n t F r a g m e n t

8 Modeling Multiprogramming CPU utilization as a function of number of processes in memory Degree of multiprogramming

9 Multiprogramming with Dynamic Partitions Partitions are created at load times Partitions are created at load times Memory at system start up OS Three processes started OS Process 1Process 2Process 3 Second processes is finished OS Process 1Process 3 A large fourth process arrives. Process 3 is relocated OS Process 1Process 3Process 4

10 Problems with Dynamic Partitions Fragmentation occurs due to creation and deletion of memory space at load time Fragmentation occurs due to creation and deletion of memory space at load time Fragmentation is eliminated by relocation Fragmentation is eliminated by relocation Relocation has to be fast to reduce overhead Relocation has to be fast to reduce overhead Free (unused) memory has to be managed Free (unused) memory has to be managed Allocation of free memory is done by a placement algorithm Allocation of free memory is done by a placement algorithm

11 Question:

12 How to Keep Track of Unused Memory Bit Maps Bit Maps Memory is divided into allocation units of fixed size. A bit map with “0” bits for free and “1” bits for allocated units Memory is divided into allocation units of fixed size. A bit map with “0” bits for free and “1” bits for allocated units Memory allocation units: Green - used, Yellow - unused Bit map of the above memory

13 How to Keep Track of Unused Memory (Cont.) Linked Lists Linked Lists Memory allocation units: Green - used, Yellow - unused U15F63U92F114 Linked list memory map

14 Placement Algorithms First fit First fit Process is placed in the first hole it can fit in Process is placed in the first hole it can fit in Next fit Next fit Start searching from the point where the last search has ended and perform first fit Start searching from the point where the last search has ended and perform first fit Best fit Best fit Process is placed in a hole which is closest to the process size Process is placed in a hole which is closest to the process size

15 Performance Issues Best Fit usually performs the worst, since it leaves behind the smallest possible hole Best Fit usually performs the worst, since it leaves behind the smallest possible hole First Fit is simplest to implement and usually fastest and best First Fit is simplest to implement and usually fastest and best Next fit is usually a little worse than First Fit Next fit is usually a little worse than First Fit

16 Another Allocation scheme: Buddy System Memory is allocated in powers of 2 sized units during load time Memory is allocated in powers of 2 sized units during load time 1 MB 512KB256KB90KB128KB300KB256KB90KB128KB300KB512KB Initially 90 KB request 300 KB request 90 KB returned

17 Buddy System (Cont.) This method makes de-allocation fast. If a block of size 2 k is released then the memory manager checks only the list of 2 k holes to merge them into a 2 k+1 sized partition This method makes de-allocation fast. If a block of size 2 k is released then the memory manager checks only the list of 2 k holes to merge them into a 2 k+1 sized partition Internal fragmentation is caused since memory requests are fitted in 2 k sized partitions Internal fragmentation is caused since memory requests are fitted in 2 k sized partitions

18 Problems with Memory Management Techniques so far Unused memory due to fragmentation Unused memory due to fragmentation Memory may contain parts of program which are not used during a run (ie., some routines may not be accessed in that particular run) Memory may contain parts of program which are not used during a run (ie., some routines may not be accessed in that particular run) Process size is limited with the size of physical memory Process size is limited with the size of physical memory Process needs contiguous space in real memory for execution Process needs contiguous space in real memory for execution

19 Can We Get Rid of These Problems? YES! YES!