Damian Gordon. HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1.

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

Chapter 6: Memory Management
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
Chapter 9 Virtual Memory Bernard Chen 2007 Spring.
Allocating Memory.
Chapter 3 Memory Management: Virtual Memory
How caches take advantage of Temporal locality
Chapter 7 Memory Management
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
CS 104 Introduction to Computer Science and Graphics Problems
Memory Organization.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Computer Organization Cs 147 Prof. Lee Azita Keshmiri.
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
Memory Management April 28, 2000 Instructor: Gary Kimura.
Dr. Abdel-Rahman Al-Qawasmi
Virtual Memory By: Dinouje Fahih. Definition of Virtual Memory Virtual memory is a concept that, allows a computer and its operating system, to use a.
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
Understanding Operating Systems Fifth Edition
Chapter 3 Memory Management: Virtual Memory
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Instructor: Yuzhuang Hu Memory Hierarchy.
Review of Memory Management, Virtual Memory CS448.
1. Memory Manager 2 Memory Management In an environment that supports dynamic memory allocation, the memory manager must keep a record of the usage of.
Operating Systems. Without an operating system your computer would be useless! A computer contains an Operating System on its Hard Drive. This is loaded.
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.”
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
1 How will execution time grow with SIZE? int array[SIZE]; int sum = 0; for (int i = 0 ; i < ; ++ i) { for (int j = 0 ; j < SIZE ; ++ j) { sum +=
1 Memory Management. 2 Fixed Partitions Legend Free Space 0k 4k 16k 64k 128k Internal fragmentation (cannot be reallocated) Divide memory into n (possible.
CS 241 Section Week #9 (11/05/09). Topics MP6 Overview Memory Management Virtual Memory Page Tables.
Memory management.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Am I RAM Or am I ROM?.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo 1 Memory management & paging.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
Virtual Memory From course notes University of Waikato. Some material by Tony McGregor Other material from: The Architecture.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Memory Management Chapter 5 Advanced Operating System.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Operating Systems, Winter Semester 2011 Practical Session 9, Memory 1.
Operating Systems c. define and explain the purpose of scheduling, job queues, priorities and how they are used to manage job throughput; d. explain how.
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
Memory Management Damian Gordon.
Introduction to Paging. Readings r 4.3 of the text book.
Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory
Memory Management By: Piyush Agarwal ( ) Akashdeep ( )
Chapter 2 Memory and process management
Understanding Operating Systems Seventh Edition
Day 20 Virtual Memory.
CSI 400/500 Operating Systems Spring 2009
Main Memory Management
Chapter 8: Main Memory.
O.S Lecture 13 Virtual Memory.
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Computer Architecture
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 32 Syed Mansoor Sarwar
CSE451 Memory Management Introduction Autumn 2002
Practical Session 9, Memory
Virtual Memory Virtual memory is a technique which gives an application program the impression that it has contiguous working memory, while in fact it.
Memory management Explain how memory is managed in a typical modern computer system (virtual memory, paging and segmentation should be described.
Contents Memory types & memory hierarchy Virtual memory (VM)
Virtual Memory 1 1.
Page Main Memory.
Presentation transcript:

Damian Gordon

HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1

HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1

HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1 Computer programs are stored here

HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1 Computer programs are stored here Until they need to be executed

HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1 Computer programs are stored here Until they need to be executed Then they are moved to here

 In modern operating systems, before a job is loaded into main memory, it is divided into chunks, called PAGES.

Job 3

 In modern operating systems, before a job is loaded into main memory, it is divided into chunks, called PAGES. Job 3 Page 2 Page 3 Page 4 Page 5 Page 6 Page 1 Page 7

 Each PAGE is loaded into memory locations called PAGE FRAMES.

200K available MAIN MEMORY

 Each PAGE is loaded into memory locations called PAGE FRAMES. MAIN MEMORY Page Frame 1 Page Frame 2 Page Frame 3 Page Frame 4 Page Frame 5 Page Frame 6 Page Frame 7 Page Frame 8 Page Frame 9 Page Frame K available

 If the PAGES are the exact same size as the PAGE FRAMES (and the same size as the disk sectors), this scheme works very well. MAIN MEMORY Page Frame 1 Page Frame 2 Page Frame 3 Page Frame 4 Page Frame 5 Page Frame 6 Page Frame 7 Page Frame 8 Page Frame 9 Page Frame K available

 The Memory Manager prepares a program for execution by doing the following: 1.Determine the number of pages in the program 2.Locate enough empty page frames in main memory 3.Load all the program’s pages into them The empty page frame does not have to be contagious.

 Consider a program that 350 bytes, and the page size is 100 bytes.

Job 1: 350 bytes

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0 Page 1

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0 Page 1 Page 2

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0 Page 1 Page 2 Page 3

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0 Page 1 Page 2 Page 3 Main Memory

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0 Page 1 Page 2 Page 3 Main Memory Operating System

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0 Page 1 Page 2 Page 3 Main Memory Operating System Page 2 Page 0 Page 1 Page 3

 Consider a program that 350 bytes, and the page size is 100 bytes. Job 1: 350 bytes Page 0 Page 1 Page 2 Page 3 Main Memory Operating System Page 2 Page 0 Page 1 Page 3 A little bit of internal fragmentation

 A useful extension to the notion of PAGING is DEMAND PAGING.  Demand Paging introduces the notion that you don’t have to load the whole program into memory, just part of it.  Because not all of the program needs to be in memory at the same time.

 This means that lots of programs can be run at the same time, and there is an illusion of a significantly larger amount of memory than with regular paging.

 To make this work, pages have to be moved very quickly from Secondary Storage to Main Memory and back again (this is called “swapping”).

 This leads to the concept of VIRTUAL MEMORY  The size of main memory appears much larger than the actual size, since many programs can appear to be fully loaded into main memory at the same time, when in actual fact, only part of many programs are loaded into main memory.