CSE451 Memory Management Introduction Autumn 2002

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 13: Main Memory (Chapter 8)
Allocating Memory.
Memory Management (II)
Chapter 3.2 : Virtual Memory
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
Chapter 7: Main Memory CS 170, Fall Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Memory Management April 28, 2000 Instructor: Gary Kimura.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
CS 346 – Chapter 8 Main memory –Addressing –Swapping –Allocation and fragmentation –Paging –Segmentation Commitment –Please finish chapter 8.
Review of Memory Management, Virtual Memory CS448.
Operating Systems Chapter 8
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 4 Memory Management Virtual Memory.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Memory Management Overview.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 33 Paging Read Ch. 9.4.
Introduction to Paging. Readings r 4.3 of the text book.
Basic Paging (1) logical address space of a process can be made noncontiguous; process is allocated physical memory whenever the latter is available. Divide.
Memory Management.
Non Contiguous Memory Allocation
Chapter 8: Main Memory.
CSE 120 Principles of Operating
CS703 - Advanced Operating Systems
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.
CSCI206 - Computer Organization & Programming
Storage Management Chapter 9: Memory Management
Operating System Concepts
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
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
Computer Architecture
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.
Main Memory Background Swapping Contiguous Allocation Paging
CS399 New Beginnings Jonathan Walpole.
Lecture 29: Virtual Memory-Address Translation
Chapter 8: Memory management
Lecture 3: Main Memory.
CSE 451: Operating Systems Autumn 2005 Memory Management
Chapter 8: Memory Management strategies
CSE451 Virtual Memory Paging Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Memory Management CSE451 Andrew Whitaker.
Evolution in memory management techniques
CS703 - Advanced Operating Systems
Evolution in memory management techniques
Evolution in memory management techniques
Chapter 8: Main Memory.
Page Main Memory.
Presentation transcript:

CSE451 Memory Management Introduction Autumn 2002 October 21, 2002 CSE451 Memory Management Introduction Autumn 2002 Gary Kimura Lecture #13 October 28, 2002 CSE 451 Introduction to Operating Systems

Today Midterm Results Memory Management Overview Virtual and physical address space A cursory look at three memory management techniques

Your job week #5 Readings in Silberschatz Chapter 9 and 10

Exam #1 Results Average score 32.1 Standard dev 8.6

Simple Programs, Simple Memory Remember back to simple programs and the memory model they use. They live in a virtual world, a linear address space not based on physical memory (i.e., reality).

Address Space Introduction First memory isn’t all scattered around with little nice names It is a set of sequentially numbered cells (bytes). Physical memory is also a set of sequentially numbered cells (bytes). In early systems your virtual world was identical to your physical world Let’s draw a picture to help illustrate the concept

Address space in more Hardware terms A logical or virtual address is the memory location generated by the CPU A physical address is the memory location of a cell as seen by the memory unit Need hardware support to quickly and transparently translate Virtual to Physical

Memory Management Units A hardware memory management unit is typically stuck between the CPU and main memory. So each memory access maps a Virtual Address to a Physical Address Virtual address space is typically larger than physical memory Hardware units are usually biased toward either paging or segmentation

Memory Management techniques What do we do when the sum of all the virtual memory doesn’t fit into physical memory? Swapping: not everyone is allowed into memory at the same time Segmentation: divide a program into logical units and allow units to be swapped in and out or memory Paging: everyone is allowed only part of their program into memory at a time Paging is really the one in vogue today, but we’ll quickly look at the other two to better understand the problem

Swapping Swapping is where executing programs are temporarily copied out of memory to a backing store such as a disk drive. This frees up physical memory for other programs to be swapped in. Swapping is similar in concept to a context switch however it is a lot more expensive.

Segmentation Another scheme for resolving virtual to physical addresses. Each function or program is assigned to a segment Hardware support needed Segment table: Each entry in the table corresponds to a segment and contains the physical base and limit of the segment Protection and sharing: Two processes can share segments. Fragmentation: It may not allows be possible to find a big enough hole in physical memory to load a new segment.

Paging Divide up virtual and physical memory into pages (usually in the 4KB or 8KB range) Hardware support needed Page table: map all virtual pages to physical pages. Page tables can be large. TLB (Translation Look-aside Buffer): cache of recently accessed page table entries. Page protection: indicates the state of each logical and physical page. Is the mapping valid and who has access to the page

Logical and physical memory in the paging model

TLB Hardware

Paging (continued) Multilevel paging: Used to reduce the amount of memory needed to store the page table. Inverted page tables: Each physical page has a table entry identifying the process. Shared pages: Physical pages can show up in multi page table entries. This allows for sharing executable code pages. It also can be used for copy-on-write pages.

Issues (addressed in later lectures) Fragmentation: Essentially wasted memory that cannot be used to store real data Internal fragmentation: Where each allocation unit potentially has a bit of wasted memory . External fragmentation: where physical memory is being divided into various sized holes. Which pages or segments should be loaded and/or removed from physical memory? How does the system allocate or grow the physical memory supporting their virtual address space and how is that represented in the system? Kernel address space has additional issues Must all the kernel code and data always be in physical memory?

Next Time Virtual Memory and a more in-depth look at paging