Memory Management By: Piyush Agarwal (2011206) Akashdeep (2011185)

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Part IV: Memory Management
Memory Management Chapter 7.
Allocating Memory.
CS 311 – Lecture 21 Outline Memory management in UNIX
Modified from Silberschatz, Galvin and Gagne Lecture 16 Chapter 8: Main Memory.
CS 104 Introduction to Computer Science and Graphics Problems
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Multistep Processing of a User Program User programs go through several steps before.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Memory management. Instruction execution cycle Fetch instruction from main memory Decode instruction Fetch operands (if needed0 Execute instruction Store.
Chapter 8 Main Memory Bernard Chen Spring Objectives To provide a detailed description of various ways of organizing memory hardware To discuss.
Chap 8 Memory Management. Background Program must be brought into memory and placed within a process for it to be run Input queue – collection of processes.
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.
Swapping and Contiguous Memory Allocation. Multistep Processing of a User Program User programs go through several steps before being run. Program components.
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.
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 8: Memory-Management Strategies Objectives To provide a detailed description.
Exam2 Review Bernard Chen Spring Deadlock Example semaphores A and B, initialized to 1 P0 P1 wait (A); wait(B) wait (B); wait(A)
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation 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.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
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.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Main Memory CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
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.
Module 9: Memory Management
Chapter 9: Memory Management
Memory Management.
Memory management.
Chapter 8: Main Memory.
Memory Allocation The main memory must accommodate both:
UNIT–IV: Memory Management
Chapter 8: Main Memory.
Chapter 8 Main Memory.
Main 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.
Operating System Concepts
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Module 9: Memory Management
OPERATING SYSTEMS MEMORY MANAGEMENT
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
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
Lecture 32 Syed Mansoor Sarwar
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
Chapter 8: Memory Management strategies
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
OPERATING SYSTEMS MEMORY MANAGEMENT BY DR.V.R.ELANGOVAN.
Page Main Memory.
Presentation transcript:

Memory Management By: Piyush Agarwal (2011206) Akashdeep (2011185)

The concept of a logical address space that is bound to a separate physical address space is central to proper memory management. • Logical address – generated by the CPU; also referred to as virtual address • Physical address – address seen by the memory unit • Logical and physical addresses are the same in compile-time and loadtime address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding scheme

JOB SCHEDULING Must take into account who wants to run, the memory needs, and partition availability. (This is a combination of short/medium term scheduling.) Sequence of events: In an empty memory slot, load a program Then it can compete for CPU time. Upon job completion, the partition becomes available. Can determine memory size required ( either user specified or automatically.

How do you allocate memory to new process? First fit - allocate the first hole that's big enough. Best fit - allocate smallest hole that's big enough. Worst fit - allocate largest hole. (First fit is fastest, worst fit has lowest memory utilization.) Avoid small holes (external fragmentation). This occurs when there are many small pieces of free memory. What should be the minimum size allocated, allocated in what chunk size? Want to also avoid internal fragmentation. This is when memory is handed out in some fixed way (power of 2 for instance) and requesting program doesn't use it all.

Long Term Scheduling If a job doesn't fit in memory, the scheduler can wait for memory skip to next job and see if it fits. What are the pros and cons of each of these? There's little or no internal fragmentation (the process uses the memory given to it the size given to it will be a page.) But there can be a great deal of external fragmentation. This is because the memory is constantly being handed cycled between the process and free.

Compatation Trying to move free memory to one large block. Only possible if programs linked with dynamic relocation (base and limit.) There are many ways to move programs in memory. Swapping: if using static relocation, code/data must return to same place.

Paging Segmentation leads to some problems like managing free space and is also not flexible. So, to virtualize memory idea of paging is introduced. Paging is one of the memory-management schemes by which a computer can store and retrieve data from secondary storage for use in main memory. In paging , we divide Logical Memory into blocks of same size called PAGES and Physical Memory into fixed-sized blocks called FRAMES.

The system will be able to support the abstraction of an address space effectively, regardless of how the processes uses the address space . This explains Paging Scheme’s flexibility. Free – Space Management explains Paging Scheme’s simplicity property. To record where each virtual page of the operating system is placed in physical memory, the operating system keeps a per-process data structure known as a page table. The major role of the page table is to store address translations for each of the virtual pages of the address space, thus letting us know where in physical memory they live.

Address Translation Scheme : Address generated by the CPU is divided into: • Page number (p) – used as an index into a page table which contains base address of each page in physical memory. • Page offset (d) – combined with base address to define the physical memory address that is sent to the memory unit.

Paging permits a program's memory to be physically non-contiguous so it can be allocated from wherever available. This avoids fragmentation and compaction.

Example : 32-byte memory with 4–byte pages

THANK YOU