CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.

Slides:



Advertisements
Similar presentations
Processes Management.
Advertisements

CS 311 – Lecture 21 Outline Memory management in UNIX
1 CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania, Fall 2002 Lecture Note: Memory Management.
© Ibrahim Korpeoglu Bilkent University
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management – 4 Page Replacement Algorithms CS 342 – Operating Systems.
Memory Management Chapter 4. Memory hierarchy Programmers want a lot of fast, non- volatile memory But, here is what we have:
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management - 2 CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
Chapter 3.1 : Memory Management
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
1 Pertemuan 11 Manajemen Memori Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS02.
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.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 5 Disks CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
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
Lecture 9: SHELL PROGRAMMING (continued) Creating shell scripts!
Avishai Wool lecture Introduction to Systems Programming Lecture 6 Memory Management.
1 Chapter 3.1 : Memory Management Storage hierarchy Storage hierarchy Important memory terms Important memory terms Earlier memory allocation schemes Earlier.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 10 Operating Systems *. 2 Chapter Goals Describe the main responsibilities of an operating system Define memory and process management Explain.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 32 Paging Read Ch. 9.4.
Memory Management By: Omar A. Cruz Salgado ICOM 5007 Sec. 121.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally MEMORYMANAGEMNT.
CS 149: Operating Systems February 26 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
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 10 Operating Systems.
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.
Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.
OS, , Part I Operating - System Structures Department of Computer Engineering, PSUWannarat Suntiamorntut.
Operating Systems COMP 4850/CISG 5550 Basic Memory Management Swapping Dr. James Money.
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.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Mono an multiprogramming.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 2 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
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 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.
Processes 2 Introduction to Operating Systems: Module 4.
CHAPTER 3-1, 3-2 MEMORY MANAGEMENT. MEMORY HIERARCHY Small amount of expensive, fast, volatile cache Larger amount of still fast, but slower, volatile.
7.1 Operating Systems. 7.2 A computer is a system composed of two major components: hardware and software. Computer hardware is the physical equipment.
Ch. 4 Memory Mangement Parkinson’s law: “Programs expand to fill the memory available to hold them.”
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.
Memory Management Damian Gordon.
Memory Management One of the most important OS jobs.
SLC/VER1.0/OS CONCEPTS/OCT'99
Memory Management.
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 2 Memory and process management
From Monoprogramming to multiprogramming with swapping
Main Memory Management
Process Virtualization. Process Process is a program that has initiated its execution. A program is a passive entity; whereas a process is an active entity.
Chapter 8: Main Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
The Operating System Memory Manager
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
Operating Systems.
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
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:

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University Department of Computer Engineering

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 2 Memory Management Memory is an important resource that must be carefully managed. Cost, size, and volatility are important parameters of memory chips. There is no single memory technology that is good in all these parameters. Therefore we have a memory hierarchy Registers, Cache, Main Memory, Disk, Tape… The part of the OS that manages the memory hierarchy is called the Memory Manager.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 3 Memory Manager Jobs Its is job is to keep track of which parts of memory are used by which programs and which parts are free. Allocate memory when programs need it, and de-allocate it when programs finished. Manage swapping of programs between memory and disk.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 4 Basic Memory Management Two classes of memory management systems  That move processes back and forth between memory and disk  That have all processes in memory during execution until termination.  We will look to this first.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 5 Basic Memory Management Memory management that has a process in memory until termination.  Mono-programming without Swapping or Paging  Multiprogramming with Fixed Partitions  Modeling Multiprogramming Analysis of Multiprogramming System Performance  Relocation and Protection

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 6 Mono-programming Run one program at a time OS and one program will exists in the memory Operating System in RAM User Program 0 0xFFFF.. User Program In RAM Operating System in ROM 0 Device Drivers in ROM Operating System in RAM User Program in RAM 0 a) b)c) Early Mainframes Palmtop Computers and Embedded Systems MS-DOS running Early PCs

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 7 Multiprogramming with Fixed Partitions Modern systems allow multiple programs to run at the same time. This allows high CPU utilization:  While a process in blocked for I/O, an other one can use CPU. Divides the memory into n partitions (possible each with different sizes) The partitioning can be done at system boot up time.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 8 Ways to use fixed partitions - 1 Partition K 200K 400K 700K 800K Partition 3 Partition 2 Partition 1 Operating System Operating System Multiple Input Queues. When a job arrives, put it into a queue for the first partition that is big enough to hold the job in memory.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 9 Ways to use fixed partitions - 2 Partition K 200K 400K 700K 800K Partition 3 Partition 2 Operating System Operating System Single Input Queue When job arrives, they are put into a single input queue Partition 1 Which job to select when a partition becomes free?

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 10 Ways to use fixed partitions - 2 Selecting a Job when a partition become free!  1) Select the first job from the start of queue that fits in to the available partition.  2) Search all the jobs and find the largest sized job that fits into the available partition.  Discriminates against small jobs.  Solve by counting the skip overs for the fitting jobs. If a job is skipped k times, then don’t skip it in the next search

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 11 Modeling Multiprogramming Multiprogramming improves CPU utilization. Assume a process spends a fraction p (0<=p<=1) of its waiting for I/O to complete. With n process in memory (n: degree of multiprogramming):  The chance that all n processes are waiting for I/O is: p n  The CPU utilization is then: 1-p n.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 12 80% I/O Wait 50% I/O Wait 20% I/O Wait

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 13 80% average I/O wait Memory Size OS Size program Size #programs that can fit (degree of multiprogramin g) CPU utilization Percent Increase in CPU utilization 32MB16MB4MB460%- 48MB16MB4MB883%38% 64MB16MB4MB1293%12%

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 14 Analysis of Multiprogramming Systems Assume 4 jobs arrive to a batch system ayt 10:00 am in the morning precisely at the following moments:  Job 1: 10:00am (requires 4 minutes of CPU)  Job 2: 10:10am (requires 3 minutes of CPU)  Job 3: 10:15am (requires 2 minutes of CPU)  Job 4: 10:20am (requires 1 minute of CPU) When does each job completes?

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 15 Analysis of Multiprogramming Systems Process 1 Process 2 Process 3 Process 4 CPU idle pnpn CPU busy p n CPU/process (1-p n )/n p = 0.8 and n is in {1, 2, 3, 4}

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 16 Analysis of Multiprogramming Systems minutes Time minutes Job 2 starts Job 2 ends Job 1 ends Time is relative to Job 1’s arrival Job 3 ends Job 3 starts