Chapter 3.1 : Memory Management

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 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:
CSCI2413 Lecture 5 Operating Systems Memory Management 1 phones off (please)
Memory Management Chapter 5.
Chapter 7 Memory Management
1 Chapter 3.1 : Memory Management Storage hierarchy Storage hierarchy Important memory terms Important memory terms Earlier memory allocation schemes Earlier.
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.
Chapter 9: Memory Management Memory management is an OS activity which controls distribution of memory among processes. The part of the OS that manages.
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.
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
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. memory management  In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. 
Memory Management One of the most important OS jobs.
Memory Management Chapter 7.
ITEC 202 Operating Systems
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:
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
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
Presentation transcript:

Chapter 3.1 : Memory Management Storage hierarchy Important memory terms Earlier memory allocation schemes Contiguous memory allocation Fixed partitions Dynamic partitions Managing free & allocated Memory Space Ceng 334 - Operating Systems

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

Important Memory Terms Ceng 334 - Operating Systems

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

Ceng 334 - Operating Systems Dos Memory Layout Ceng 334 - Operating Systems

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

Multiprogramming with Fixed Partitions OS Partition 1 Partition 2 Partition 3 Process 1 Process 2 Process 3 F r a g m e n t 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 Ceng 334 - Operating Systems

Modeling Multiprogramming Degree of multiprogramming CPU utilization as a function of number of processes in memory Ceng 334 - Operating Systems

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

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

Ceng 334 - Operating Systems Question: HOW DO YOU RELOCATE A PROCESS? Ceng 334 - Operating Systems

How to Keep Track of Unused Memory 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 allocation units: Green - used, Yellow - unused 1 Bit map of the above memory Ceng 334 - Operating Systems

How to Keep Track of Unused Memory (Cont.) Linked Lists Memory allocation units: Green - used, Yellow - unused 1 2 3 4 5 6 7 8 9 10 11 12 13 14 U 1 5 F 6 3 9 2 11 4 Linked list memory map Ceng 334 - Operating Systems

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

Ceng 334 - Operating Systems Performance Issues 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 Next fit is usually a little worse than First Fit Ceng 334 - Operating Systems

Another Allocation scheme: Buddy System Memory is allocated in powers of 2 sized units during load time Initially 1 MB 90 KB request 512KB 256KB 90KB 128KB 300 KB request 300KB 256KB 90KB 128KB 90 KB returned 300KB 512KB Ceng 334 - Operating Systems

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

Problems with Memory Management Techniques so far 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) Process size is limited with the size of physical memory Ceng 334 - Operating Systems

Can We Get Rid of These Problems? YES! VIRTUAL MEMORY Ceng 334 - Operating Systems