Memory Management April 28, 2000 Instructor: Gary Kimura.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Segmentation and Paging Considerations
CS 153 Design of Operating Systems Spring 2015
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
CS 333 Introduction to Operating Systems Class 11 – Virtual Memory (1)
Memory Management (II)
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Paging Design.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
Chapter 3.2 : Virtual Memory
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.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Computer Organization and Architecture
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.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Paging. Memory Partitioning Troubles Fragmentation Need for compaction/swapping A process size is limited by the available physical memory Dynamic growth.
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.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Review of Memory Management, Virtual Memory CS448.
Operating Systems Chapter 8
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
CS 153 Design of Operating Systems Spring 2015 Lecture 17: Paging.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
IT253: Computer Organization
Lecture Topics: 11/17 Page tables TLBs Virtual memory flat page tables
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.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
1 Some Real Problem  What if a program needs more memory than the machine has? —even if individual programs fit in memory, how can we run multiple programs?
Review °Apply Principle of Locality Recursively °Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
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.
Memory Management.
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
Chapter 8: Main Memory.
Lecture 28: Virtual Memory-Address Translation
CSCI206 - Computer Organization & Programming
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Lecture 29: Virtual Memory-Address Translation
CPSC 457 Operating Systems
Lecture 3: Main Memory.
CSE451 Memory Management Introduction Autumn 2002
CSE 451: Operating Systems Autumn 2005 Memory Management
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
CS703 - Advanced Operating Systems
COMP755 Advanced Operating Systems
Page Main Memory.
Presentation transcript:

Memory Management April 28, 2000 Instructor: Gary Kimura

26/30/2015 A quote for current and potential pilots On takeoff, if your engine should fail and you must crash land the plane. Don’t worry about putting a scratch on the plane. The plane is expendable, remember this quote “The airplane failed me, and it deserves what ever it gets!” The same could be said for some computers and operating systems.

36/30/2015 Topics for the next few weeks Memory Management introduction, concepts, hardware, and general ideas Memory Management data structures and implementation issues Page replacement strategies Kernel pool allocation (paged versus non-paged) Cache Manager design and policy I/O System, and File System design Coding fault and trap handlers Then on to ancillary issues such as distributed system and RPC

46/30/2015 Address Spaces 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 Early systems lacked the notion of virtual addresses, everything was done using physical addresses.

56/30/2015 Logical and physical memory

66/30/2015 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

76/30/2015 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 –Paging: everyone is allowed only part of their program into memory at a time –Segmentation: divide a program into logical units and allow units to be swapped in and out or memory

86/30/2015 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.

96/30/2015 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

106/30/2015 TLB Hardware

116/30/2015 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.

126/30/2015 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.

136/30/2015 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?