MEMORY MANAGEMENT Operating System. Memory Management Memory management is how the OS makes best use of the memory available to it Remember that the OS.

Slides:



Advertisements
Similar presentations
MEMORY MANAGEMENT Y. Colette Lemard. MEMORY MANAGEMENT The management of memory is one of the functions of the Operating System MEMORY = MAIN MEMORY =
Advertisements

Part IV: 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 is achieved.
Chapter 6: Memory Management
Memory Management Chapter 7.
Allocating Memory.
Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2009, Prentice.
Hash Table indexing and Secondary Storage Hashing.
Multiprocessing Memory Management
Chapter 3.1 : Memory Management
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Memory Management Chapter 5.
Computer Organization and Architecture
Operating System Concepts
1 Chapter 3.1 : Memory Management Storage hierarchy Storage hierarchy Important memory terms Important memory terms Earlier memory allocation schemes Earlier.
Review of Memory Management, Virtual Memory CS448.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Operating System 7 MEMORY MANAGEMENT. MEMORY MANAGEMENT REQUIREMENTS.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Dr.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Ch. 4 Memory Mangement Parkinson’s law: “Programs expand to fill the memory available to hold them.”
CY2003 Computer Systems Lecture 09 Memory Management.
Memory Management. Roadmap Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management –Paging –Segmentation.
Subject: Operating System.
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.
1 Memory Management Requirements of memory management system to provide the memory space to enable several processes to execute concurrently to provide.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
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.
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
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.
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.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
Operating Systems Lecture 31.
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.
Ch. 4 Memory Mangement Parkinson’s law: “Programs expand to fill the memory available to hold them.”
Operating Systems Lecture 31 Syed Mansoor Sarwar.
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.
Deadlock Avoidance Determine whether, by allowing allocation, we could get a deadlock, i.e. check if by allowing allocation the system could enter a state.
Chapter 7 Memory Management
Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory
Memory Management.
Chapter 2 Memory and process management
Day 19 Memory Management.
Day 19 Memory Management.
Memory Allocation The main memory must accommodate both:
Day 18 Memory Management.
Main Memory Management
Module IV Memory Organization.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Economics, Administration & Information system
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Chapter 9: Virtual-Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Operating System Chapter 7. Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Management From the memory view, we can list four important tasks that the OS is responsible for ; To know the used and unused memory partitions To allocate.
Operating Systems: Internals and Design Principles, 6/E
Presentation transcript:

MEMORY MANAGEMENT Operating System

Memory Management Memory management is how the OS makes best use of the memory available to it Remember that the OS takes up memory space of its own When there are many programs sharing the same memory in a computer, there is always the potential for addresses to become ‘mixed-up’ and hence cause the program(s) to crash This memory management can be done in a couple of different ways

Fixed Partitioning In this scenario the available memory space is ‘partitioned’ into appropriate fixed length sizes These could be all of the same size or of differing sizes Programs are then simply loaded into the appropriate partition when one becomes available This is a relatively simple algorithm for the OS to deal with

Disadvantages The disadvantage however is that long queues can build-up and memory wasted as programs don’t always fit into a particular partition and hence can’t be started directly – needing to wait for a larger partition to become available Also programs that are using a partition maybe wasteful of memory as they are unlikely to require the full amount of space available The partitioning of the memory in the first place also sets an arbitrary limit on the number of programs that can be run at one time

Memory Management

Memory Management & Buffering The memory has been divided into 5 partitions  2 with 300MB of memory  2 with 200MB of memory  1 with 100MB of memory Limitation therefore of a maximum of 5 programs running at the same time

Memory Management & Buffering Assuming the following programs need to be run - how efficient is the current partitioning of the memory?

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Run300 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Run300 / 1100 Program 2300Run600 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Run300 / 1100 Program 2300Run600 / 1100 Program 3200Wait600 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Run300 / 1100 Program 2300Run600 / 1100 Program 3200Wait600 / 1100 Program 4200Run800 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Run300 / 1100 Program 2300Run600 / 1100 Program 3300Wait600 / 1100 Program 4200Run800 / 1100 Program 5200Run1000 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Complete0 / 1100 Program 2300Run300 / 1100 Program 3300Run600 / 1100 Program 4200Run800 / 1100 Program 5200Run1000 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Complete0 / 1100 Program 2300Run300 / 1100 Program 3300Run600 / 1100 Program 4200Run800 / 1100 Program 5200Run1000 / 1100 Program 6200Wait1000 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Complete0 / 1100 Program 2300Run300 / 1100 Program 3300Complete300 / 1100 Program 4200Run500 / 1100 Program 5200Run700 / 1100 Program 6200 (300)Run1000 / 1100

Memory Management & Buffering ProgramSizeActionMemory Used Program 1300Complete0 / 1100 Program 2300Run300 / 1100 Program 3300Complete300 / 1100 Program 4200Run500 / 1100 Program 5200Run700 / 1100 Program 6200 (300)Run1000 / 1100

Memory Management & Buffering Using variable partitioning is a much more complex process This allows for partitions to be created dynamically as and when required This may seem to be the perfect solution BUT…there are problems When a program completes it obviously releases that partition(memory) for use by another program

Memory Management & Buffering However the new program is unlikely to be exactly the same size as the one that finishes This will mean that the next program either requires more or less memory than was in the previous partition If more is required the partition will then have to link two separate parts of memory to create a fragmented partition If less space is required, the ‘left over’ memory will itself become fragmented The longer this process goes on, the more fragmented partitions will be created

Memory Management & Buffering This will lead to a decrease in efficiency as the algorithms required to allocate the memory space will become increasingly more complex From time-to-time the memory will need to be defragmented to enable the system to continue working efficiently

Memory Management & Buffering Buffering is used to convert the physical blocks (of data) into the logical records used by the application software The OS usually carries out this process The area in main memory into which the physical blocks are loaded initially is known as the buffer This process of changing the physical blocks to logical records is usually transparent to the user

Memory Management & Buffering Physical Block 1 Physical Block 2 Physical Block 3 OS Software Secondary storage hardware Physical blocks on tape, disc, CD etc Physical Block 2 Physical block in main memory BUFFER OS Software Logical Rec 1 Logical Rec 2 Logical Rec 3 Logical Rec 4 Logical records in main memory Application Software Field 1 Field 2 Field 3 Field 4 Field 5 Data interpreted by application

Memory Management & Buffering The diagram makes use of just a single buffer, but if a faster speed of response is required it is usual to make use of two buffers – double buffering This means that while one physical block is being interpreted, another can be being loaded – leading to a more efficient and hence quicker response time