CSC 360, Instructor Kui Wu Memory Management I: Main Memory.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Memory Management.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Main Memory CS Memory Management1. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main.
Chapter 9: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Chapter 9: Memory Management Background.
Background A program must be brought into memory and placed within a process for it to be executed. Input queue – collection of processes on the disk that.
Memory Management.
03/10/2004CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
1 Friday, June 30, 2006 "Man's mind, once stretched by a new idea, never regains its original dimensions." - Oliver Wendell Holmes, Jr.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Memory Management Gordon College Stephen Brinton.
Chapter 8: Main Memory.
Chapter 7: Main Memory CS 170, Fall Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
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.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Chapter 8: Main Memory.
 Background  Swapping  Contiguous Allocation  Paging  Segmentation  Segmentation with Paging.
Chap 8 Memory Management. Background Program must be brought into memory and placed within a process for it to be run Input queue – collection of processes.
XE33OSA Chapter 8: Memory Management. 8.2XE33OSA Silberschatz, Galvin and Gagne ©2005 Chapter 8: Memory Management Background Swapping Contiguous Allocation.
Chapter 8: Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Background Program must be brought.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Memory Management -1 Background Swapping Memory Management Schemes
Example of a Resource Allocation Graph CS1252-OPERATING SYSTEM UNIT III1.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
CS212: OPERATING SYSTEM Lecture 5: Memory Management Strategies 1 Computer Science Department.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Memory Management 1. Background Programs must be brought (from disk) into memory for them to be run Main memory and registers are only storage CPU can.
Silberschatz and Galvin  Operating System Concepts Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous.
CE Operating Systems Lecture 14 Memory management.
Chapter 8: Memory-Management Strategies. 8.2Operating System Principles Chapter 8: Memory-Management Strategies Background Swapping Contiguous Memory.
9.1 Operating System Concepts Paging Example. 9.2 Operating System Concepts.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Chapter 8: Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Memory and Addressing It all starts.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
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.
Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging.
Chapter 5 Memory Management. 2 Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Chapter 2: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
1 Chapter 8: Main Memory. 2 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition, Chapter 8: Memory- Management Strategies.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 8: Memory-Management Strategies.
Chapter 8: Main Memory.
Chapter 8: Main Memory.
Operating System Concepts
Segmentation Lecture November 2018.
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.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Memory Management-I 1.
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 3: Main Memory.
Chapter 8: Memory Management strategies
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Lecture 35 Syed Mansoor Sarwar
Presentation transcript:

CSC 360, Instructor Kui Wu Memory Management I: Main Memory

CSC 360, Instructor Kui Wu Agenda 1.Background 2.Swapping 3.Continuous Memory Allocation 4.Paging 5.Segmentation

CSC 360, Instructor Kui Wu CSc Background (1): Storage hierarchy CPU direct access registers (main) memory –cache

CSC 360, Instructor Kui Wu CSc Background (2): Memory access Access by address for both code and data Address binding compiler time: absolute code –MS-DOS.COM format, 64KB limit load time: relocatable code –MS-DOS.EXE format execution time

CSC 360, Instructor Kui Wu CSc Background (3): Memory space Logical memory seen by CPU virtual memory Physical memory seen by memory unit Address binding compile/load time: logical/physical addr same execution time: logical/physical address differ

CSC 360, Instructor Kui Wu CSc Background (4): Memory management MMU: memory management unit logical/physical memory mapping Relocation register physical address = logical address + relocation base Dynamic loading Dynamic linking

CSC 360, Instructor Kui Wu CSc Background (5): Memory protection With base and limit registers With limit and relocation registers physical

CSC 360, Instructor Kui Wu CSc Swapping Swap out e.g., low priority reduce the degree of multiprogramming Swap in address binding Swapping overhead on-demand

CSC 360, Instructor Kui Wu CSc Contiguous Memory Allocation (1) Single-partition allocation one for OS the other one for user process Multi-partition allocation OS process 5 process 8 process 2 OS process 5 process 2 OS process 5 process 2 OS process 5 process 9 process 2 process 9 process 10

CSC 360, Instructor Kui Wu CSc Contiguous Memory Allocation (2): Partition allocation First-fit first “hole” big enough to hold faster search Best-fit smallest “hole” big enough to hold Worst-fit largest “hole” big enough to hold

CSC 360, Instructor Kui Wu CSc Contiguous Memory Allocation (3): Fragmentation External fragmentation enough total available size, not individual ones Compaction combine all free partitions together possible if dynamic allocation at execution time issues with I/O (e.g., DMA) Internal fragmentation difference between allocated and request size

CSC 360, Instructor Kui Wu CSc Paging (1) Noncontiguous allocation in fixed size pages page size: normally 512B ~ 8KB Fragmentation no external fragmentation –unless there is no free page still have internal fragmentation –maximum: page_size - 1

CSC 360, Instructor Kui Wu CSc Paging (2): Supporting paging Access by address seen by CPU –logical page number –page offset –“frame” seen by memory –physical page number –page offset Page-table registers one more memory access

CSC 360, Instructor Kui Wu CSc Paging (3): Supporting paging: more TLB translation look-aside buffer associative Access by content if hit, output frame # otherwise, check page table

CSC 360, Instructor Kui Wu CSc Paging (4): Page table

CSC 360, Instructor Kui Wu CSc Paging (5): Paging example

CSC 360, Instructor Kui Wu CSc Paging (6): Page table with TLB Translation Look-aside Buffer (TLB) associative memory

CSC 360, Instructor Kui Wu CSc Paging (7): Page table: valid bit

CSC 360, Instructor Kui Wu CSc Paging (8): Shared pages Shared code one read-only code same address in logical space Private code + data one copy per process

CSC 360, Instructor Kui Wu CSc Paging (9): Hierarchical page table Difficulty with a table of too many entries where to keep the table how to lookup efficiently Solution e.g., 2-level table

CSC 360, Instructor Kui Wu CSc Hash + linked list 4. Paging (10): Hash page table

CSC 360, Instructor Kui Wu CSc Paging (11): Inverted page table When physical space << logical space Tradeoff time space

CSC 360, Instructor Kui Wu CSc Segmentation (1): User's view of a program A collection of segments main program symbol table procedures/functions data stacks heaps

CSC 360, Instructor Kui Wu CSc Segmentation (2): Logical view of segmentation user spacephysical memory space

CSC 360, Instructor Kui Wu CSc Logical address consists of a two tuple:, Segment table – maps two-dimensional physical addresses; each table entry has: – base – contains the starting physical address where the segments reside in memory – limit – specifies the length of the segment Segment-table base register (STBR) points to the segment table’s location in memory Segment-table length register (STLR) indicates number of segments used by a program; segment number s is legal if s < STLR 5. Segmentation (3): Segmentation Architecture

CSC 360, Instructor Kui Wu CSc Segmentation (4): Segment table

CSC 360, Instructor Kui Wu CSc Segmentation (5): Example of segmenting