Operating Systems Lecture 31.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Memory Management Chapter 7.
Memory Management Chapter 7. Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as.
Chapter 9 Memory Management
CS 311 – Lecture 21 Outline Memory management in UNIX
Memory Management. Managing Memory … The Simplest Case The O/S User Program 0 0xFFF … * Early PCs and Mainframes * Embedded Systems One user program at.
Modified from Silberschatz, Galvin and Gagne Lecture 16 Chapter 8: Main Memory.
Memory Management Chapter 4. Memory hierarchy Programmers want a lot of fast, non- volatile memory But, here is what we have:
Module 3.0: Memory Management
03/09/2007CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
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 Five Requirements for Memory Management to satisfy: –Relocation Users generally don’t know where they will be placed in main memory May.
Operating System Concepts
Silberschatz, Galvin and Gagne  Operating System Concepts Multistep Processing of a User Program User programs go through several steps before.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
CSCI 315 Operating Systems Design
1 Lecture 8: Memory Mangement Operating System I Spring 2008.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 8 Operating Systems.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
Swapping and Contiguous Memory Allocation. Multistep Processing of a User Program User programs go through several steps before being run. Program components.
Lecture 13 L.Mohammad R.Alkafagee1.  The concept of a logical address space that is bound to a separate physical address space is central to proper memory.
Memory Management Chapter 7.
Chapter 8: Memory-Management Strategies
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
A genda for Today What is memory management Source code to execution Address binding Logical and physical address spaces Dynamic loading, dynamic linking,
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.
Operating Systems Memory Management.
Cosc 4740 Chapter 7 Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Input queue –
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 8: Memory-Management Strategies Objectives To provide a detailed description.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
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 and Galvin  Operating System Concepts Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous.
Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
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.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Memory- Management Strategies.
NETW3005 Memory Management. Reading For this lecture, you should have read Chapter 8 (Sections 1-6). NETW3005 (Operating Systems) Lecture 07 – Memory.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 31 Memory Management.
Memory Management and Virtual Memory
Operating Systems Lecture 31 Syed Mansoor Sarwar.
Memory Management 1. Outline Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation 2.
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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 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.
SLC/VER1.0/OS CONCEPTS/OCT'99
Chapter 8: Main Memory Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Main Memory Management
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Chapter 8: Main Memory.
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.
Main Memory Background Swapping Contiguous Allocation Paging
Memory Management Tasks
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 30 Syed Mansoor Sarwar
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.
Presentation transcript:

Operating Systems Lecture 31

Dynamic Linking In static linking, system language libraries are linked at compile time and, like any other object module, are combined by the loader into the binary image

Dynamic Linking In dynamic linking, linking is postponed until run-time. A library call is replaced by a piece of code, called stub, which is used to locate memory-resident library routine

Dynamic Linking During execution of a process, stub is replaced by the address of the relevant library code and the code is executed If library code is not in memory, it is loaded at this time

Dynamic Linking Advantages Potentially less time needed to load a program Potentially less memory space needed Less disk space needed to store binaries

Dynamic Linking Disadvantages gcc compiler Time-consuming run-time activity, resulting in slower program execution gcc compiler Dynamic linking by default -static option allows static linking

Overlays Allow a process to be larger than the amount of memory allocated to it Keep in memory only those instructions and data that are needed at any given time

Overlays When other instructions are needed, they are loaded into the space occupied previously by instructions that are no longer needed Implemented by user Programming design of overlay structure is complex and not possible in all cases

Overlays Example 2-Pass assembler/compiler Available main memory: 150k Code size: 200k Pass 1 ……………….. 70k Pass 2 ……………….. 80k Common routines …... 30k Symbol table ………… 20k

Overlays Example

Swapping Swap out and swap in (or roll out and roll in) Major part of swap time is transfer time; the total transfer time is directly proportional to the amount of memory swapped Large context switch time

Swapping

Cost of Swapping Process size = 1 MB Transfer rate = 5 MB/sec Swap out time = 1/5 sec = 200 ms Average latency = 8 ms Net swap out time = 208 ms Swap out + swap in = 416 ms

Issues with Swapping Quantum for RR scheduler Pending I/O for swapped out process User space used for I/O Solutions Don’t swap out processes with pending I/O Do I/O using kernel space

Contiguous Allocation Kernel space, user space A process is placed in a single contiguous area in memory Base (re-location) and limit registers are used to point to the smallest memory address of a process and its size, respectively.

Contiguous Allocation Process Main Memory

MFT Multiprogramming with fixed tasks (MFT) Memory is divided into several fixed-size partitions. Each partition may contain exactly one process/task.

MFT Boundaries for partitions are set at boot time and are not movable. An input queue per partition The degree of multiprogramming is bound by the number of partitions.

MFT Partition 4 Partition 3 100 K Partition 2 Partition 1 OS 300 K Input Queues 200 K 150 K

MFT With Multiple Input Queues Potential for wasted memory space—an empty partition but no process in the associated queue Load-time address binding

MFT With Single Input Queue Single queue for all partitions Search the queue for a process when a partition becomes empty First-fit, best-fit, worst-fit space allocation algorithms

MFT With Single Input Queue Partition 4 Partition 3 Partition 2 Partition 1 OS 100 K 300 K Input Queue 200 K 150 K

MFT Issues Internal fragmentation—wasted space inside a fixed-size memory region No sharing between processes. Load-time address binding with multiple input queues