CSI 400/500 Operating Systems Spring 2009

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Allocating Memory.
Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2009, Prentice.
Multiprocessing Memory Management
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.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
CSI 400/500 Operating Systems Spring 2009 Lecture #9 – Paging and Segmentation in Virtual Memory Monday, March 2 nd and Wednesday, March 4 th, 2009.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
Computer Organization and Architecture
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
1 Lecture 8: Memory Mangement Operating System I Spring 2008.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
Review of Memory Management, Virtual Memory CS448.
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
© 2004, D. J. Foreman 1 Memory Management. © 2004, D. J. Foreman 2 Building a Module -1  Compiler ■ generates references for function addresses may be.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
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.
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
Memory Management. Roadmap Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management –Paging –Segmentation.
6 Memory Management and Processor Management Management of Resources Measure of Effectiveness – On most modern computers, the operating system serves.
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.
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.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
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 7 Memory Management
Memory Management Chapter 7.
Memory Management By: Piyush Agarwal ( ) Akashdeep ( )
Memory Management.
ITEC 202 Operating Systems
Chapter 2 Memory and process management
Understanding Operating Systems Seventh Edition
Chapter 8: Main Memory.
Memory Management © 2004, D. J. Foreman.
Chapter 9 – Real Memory Organization and Management
William Stallings Computer Organization and Architecture
Main Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Segmentation Lecture November 2018.
MEMORY MANAGEMENT & their issues
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
Computer Architecture
Module IV Memory Organization.
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
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 32 Syed Mansoor Sarwar
CS399 New Beginnings Jonathan Walpole.
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.
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.
COMP755 Advanced Operating Systems
Operating Systems: Internals and Design Principles, 6/E
Page Main Memory.
Presentation transcript:

CSI 400/500 Operating Systems Spring 2009 Lecture #8 – Memory Management February 23rd through 25th, 2009

Memory Hierarchy Primary Secondary External

Primary Memory Used by processors and running processes Includes: Registers – holds operation data for processor Cache – holds immediate storage for process RAM – processing address space Cache memory contains the current page or segment of storage being executed by the processor. Designed for quick access, as no translation or disk retrieval is necessary RAM memory is the entire storage capacity of the computer. It contains the data of all loaded programs, whether running or held. It also contains system storage like interrupt handling routines, system calls, etc.

Secondary Memory Memory not allocated to processors or tasks Includes “virtual memory”, which is extended memory for tasks containing data not currently being used Used to store data for extended periods of time Examples: hard drive, disks, flash drives

External Memory Storage device external to computer Located on network, either local or wide Examples: database server, web page

Memory Manager Component of Operating System that handles allocation, loading, reading, writing, and clearing of primary and secondary memory Resolves references and/or calls to external data

Memory Manager Tasks

Loading Copying process data stored in RAM or secondary memory into cache memory “Page loading” Reading external data and loading into cache memory “Remote accessing”

Binding Process of translating virtual address into physical address Most programs use more storage than cache can hold, so virtual address refers to RAM location without needing extremely long address Address can still fit into register Allows for continual extension of “onboard” memory space We will discuss how this translation works later, as we discuss different ways of sharing total RAM across processes.

Saving Restore data to secondary memory Write data to external memory “Reallocation” Write data to external memory “Uploading” Saving data may involve network communication or file management. We will discuss these concepts in their own lecture topics.

Allocation Distributing memory among processes Process’ available space called “address space” Three main techniques: Fixed-Partition Variable-Partition Dynamic

Fixed Partition Allocation Called pages System has predetermined page size Only one page per process in cache at a time Common in batch and time-share systems

How Paging Works Process allocated a page Data is filled in from start to end New data added to end of last data block, allowing for data boundaries If page fills, new page is allocated Pages tracked with Page Table We’ll discuss that in a few sessions

Internal Fragmentation If data freed during process, Memory Manager will attempt to reuse Desired data must be same size or smaller Could leave “holes” on page, called “internal fragmentation” Internal fragmentation cleared by page reallocation Copies existing data to new page, then clearing old page Show how these “holes” develop

Variable Partition Allocation Called segments Memory Manager obtains storage as process produces data or needs external data All current processes share memory Each process has its own piece of memory Common in Client-Server systems

How Segmentation Works System starts with blank page Processes are created and queued Initial data for each process allocated a segment Segments contiguous in storage New segments added if processes created or processes demand more

External Fragmentation As processes release data or processes complete, data is freed System tries to reuse data Request must be at most same size Could leave “holes” called “external fragmentation” Freed storage too small to use at current time Most systems maintain a Free Space table to track these fragments

Defragmentation Also called “dynamic relocation” Moving segments to fill external fragments Logical addresses reset using dynamic binding We’ll discuss that with dynamic allocation

Dynamic Allocation Process allowed to specify and change size of its storage If that much space is not available, process held until space is available Often requested storage obtained in chunks, using multiple free space fragments Space chained together via linked list

Dynamic Binding Memory Manager can move segment around as process executes All process data referenced by symbol name Variable name if defined, or system-created name Process maintains Symbol Table to resolve reference Dynamic Binding means Memory Manager resolves to new physical address when process references data

How Dynamic Binding Works When data placed in segment, entry added to symbol table Entry is offset in segment Processor has Relocation Register Contains start address of segment Segment moves due to dynamic relocation Address in relocation register changes Subsequent reference resolves to new physical location

Swapping Process of saving process’ current address page to secondary storage and loading new address page Process is blocked during this time, as execution requires new data

Swapping Process Process requests non-resident data Processor blocks process and sends I/O interrupt Interrupt Handler contacts Memory Manager with data reference Memory Manager swaps out current page, finds new page, and swaps it in Tells Interrupt Handler it is done Interrupt Handler releases process to Ready queue