Chapter 9 Memory Management

Size: px
Start display at page:

Download "Chapter 9 Memory Management"

Transcription

1 Contents 1. Introuction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threas 6. CPU Scheuling 7. Process Synchronization 8. Dealocks 9. Memory Management 10.Virtual Memory 11.File Systems Chapter 9 Memory Management

2 Memory Management Motivation Keep several processes in memory to improve a system s s performance Selection of ifferent memory management methos Application-epenent Harware-epenent epenent Memory A large array of wors or bytes, each with its own aress. Memory is always too small! Memory Management The Viewpoint of the Memory Unit A stream of memory aresses! What shoul be one? Which areas are free or use (by whom) Decie which processes to get memory Perform allocation an e-allocation Remark: Interaction between CPU scheuling an memory allocation!

3 Backgroun Aress Bining bining of instructions an ata to memory aresses Bining Time Known at compile time, where a program will be in memory - absolute coe MS-DOS *.COM At loa time: - All memory reference by a program will be translate - Coe is relocatable - Fixe while a program runs other object moules system library source program object moule loa moule compiling linking loaing symbolic aress e.g., x Relocatable aress At execution time - bining may change as a program run ynamically loae system library in-memory binary memory image Absolute aress Backgroun Main Memory Bining at the Compiling Time A process must execute at a specific memory space Bining at the Loa Time Relocatable Coe Process may move from a memory segment to another bining is elaye till run-time

4 Logical Versus Physical Aress CPU Logical Aress 346 The user program eals with logical aresses - Virtual Aresses (bining at the run time) + Relocation Register Memory Management Unit (MMU) Harware-Support Physical Aress Memory Aress Register Memory Logical Versus Physical Aress A logical (physical) aress space is the set of logical (physical) aresses generate by a process. Physical aresses of a program is transparent to any process! MMU maps from virtual aresses to physical aresses. Different memory mapping schemes nee ifferent MMU s that are harware evices. (slow own) Compile-time & loa-time bining schemes results in the collapsing of logical an physical aress spaces.

5 Dynamic Loaing Dynamic Loaing A routine will not be loae until it is calle. A relocatable linking loaer must be calle to loa the esire routine an change the program s s aress tables. Avantage Memory space is better utilize. Users may use OS-provie libraries ies to achieve ynamic loaing Dynamic Linking Dynamic Linking Linking A small piece of coe, calle stub, is use to locate or loa the appropriate routine Avantage Save memory space by sharing the library coe among processes Memory Protection & Library Upate! Static language library + program object moule binary program image Simple

6 Overlays Motivation Keep in memory only those instructions an ata neee at any given time. Example: Two overlays of a two-pass assembler Symbol table 20KB common routines overlay river 30KB 10KB Certain relocation & linking algorithms are neee! 70KB Pass 1 Pass 2 80KB Overlays Memory space is save at the cost of run-time I/O. Overlays can be achieve w/o OS support: absolute-aress coe However, it s s not easy to program a overlay structure properly! Nee some sort of automatic techniques that run a large program in a limite physical memory!

7 Swapping User Space OS swap out swap in Process p1 Process p2 Main Memory Backing Store Shoul a process be put back into the same memory space that it occupie previously? Bining Scheme?! Swapping A Naive Way W Pick up a process from the reay queue Dispatcher checks whether the process is in memory Yes Dispatch CPU to the process No Swap in the process Potentially High Context-Switch Cost: 2 * (1000KB/5000KBps + 8ms) = 416ms Transfer Time Latency Delay

8 Swapping The execution time of each process shoul be long relative to the swapping time in this case (e.g., 416ms in the last example)! 100k isk = 100ms 1000k per sec + Only swap in what is actually use. 100k isk = 100ms 1000k per sec + Users must keep the system informe of memory usage. OS Who shoul be swappe out? Lower Priority Processes? es? Any Constraint? System Design Pi Memory I/O buffering I/O buffering?i/o? Swapping Separate swapping space from the file system for efficient usage Disable swapping whenever possible such as many versions of UNIX Swapping is triggere only if the memory usage passes a threshol, an many processes are running! In Winows 3.1, a swappe-out process is not swappe in until the user selects the process to run.

9 Contiguous Allocation Single User 0000 OS a User b Unuse 8888 relocation register A single s user is allocate as much memory as neee Problem: Size Restriction Overlays (MS/DOS) a limit register b Contiguous Allocation Single User Harware Support for for Memory Mapping an Protection CPU < + logical aress limit register No trap Yes relocation register physical aress memory Disavantage: Wasting of CPU an Resources No Multiprogramming Possible

10 Contiguous Allocation Multiple Users Fixe Partitions Partition 1 Partition 2 Partition 3 Partition 4 20k 45k 60k 90k 100k proc 1 proc 7 proc 5 fragmentation Memory is ivie into fixe partitions, e.g., OS/360 (or MFT) A process is allocate on an entire partition An OS Data Structure: Partitions # size location status KB 15KB 30KB 10KB 20k 45k 60k 90k Use Use Use Free Contiguous Allocation Multiple Users Harware Supports Boun registers Each partition may have a protection key (corresponing to a key in the current PSW) Disavantage: Fragmentation gives poor memory utilization!

11 Contiguous Allocation Multiple Users Dynamic Partitions Partitions are ynamically create. OS tables recor free an use partitions 20k 40k 70k 90k 110k OS Process 1 free Process 2 free Use Free Input Queue Base = 20k size = 20KB user = 1 Base = 40k size = 30KB Base = 70k size = 20KB user = 2 Base = 90k size = 20KB P3 with a 40KB memory request! Contiguous Allocation Multiple Users Better in Time an Storage Usage Solutions for ynamic storage allocation : First Fit Fin a hole which is big enough Avantage: Fast an likely ly to have large chunks of memory in high memory locations Best Fit Fin the smallest hole which is big enough. It might nee a lot of search time an create lots of small fragments! Avantage: Large chunks of memory available Worst Fit Fin the largest hole an create a new partition out of it! Avantage: Having largest leftover holes s with lots of search time!

12 Contiguous Allocation Example First Fit (RR Scheuler with Quantum = 1) 400k 2560k 400k 1000k 1700k 2000k 2300k 2560k OS OS OS 400k 1000k 2000k 2300k 2560k P1 P2 P3 400k 1000k 2000k 2300k 2560k A job queue Time = 0 Time = 0 Time = 14 OS OS OS P1 P4 P3 400k 1000k 1700k 2000k 2300k 2560k P4 P3 Process Memory Time P1 600KB 10 P2 1000KB 5 P3 300KB 20 P4 700KB 8 P5 500KB 15 Time = 14 Time = 28 Time = 28 P1 P3 400k 900k 1000k 1700k 300KB 2000k + 560KB 2300k 260KB P5? 2560k P2 terminates & frees its memory P5 P4 P3 Fragmentation Dynamic Partitions External fragmentation occurs as small chunks of memory accumulate as a by- prouct of partitioning ue to imperfect fits. Statistical Analysis For the First-Fit Fit Algorithm: 1/3 memory is unusable 50-percent rule Solutions: a. Merge ajacent free areas. b. Compaction - Compact all free areas into one contiguous region - Requires user processes to be relocatable Any optimal compaction strategy???

13 Fragmentation Dynamic Partitions 0 300K 500K 600K 1000K 1200K 1500K 1900K 2100K OS P1 P2 400KB P3 300KB P4 200KB 0 300K 500K 600K 800K 1200K 2100K OS P1 P2 *P3 *P4 900K OS P1 P2 *P4 P3 900K Cost: Time Complexity O(n!)?!! Combination of swapping an compaction Dynamic/static relocation 0 300K 500K 600K 1000K 1200K 2100K 0 300K 500K 600K 1500K 1900K 2100K OS P1 P2 900K P3 *P4 MOVE 600KB MOVE 400KB MOVE 200KB Fragmentation Dynamic Partitions Internal fragmentation: A small chunk of unuse memory internal to a partition. OS P1 20,002 bytes P2 P3 request 20KB?? give P3 20KB & leave a 2-byte free area?? Reuce free-space maintenance cost Give 20,002 bytes to P3 an have 2 bytes as an internal fragmentation!

14 Fragmentation Dynamic Partitions Dynamic Partitioning: Avantage: Eliminate fragmentation to some egree Can have more partitions an a higher egree of multiprogramming Disavantage: Compaction vs Fragmentation The amount of free memory may not be enough for a process! (contiguous allocation) Memory locations may be allocate but never reference. Relocation Harware Cost & Slow Down Solution: Page Memory! Paging Objective Users see a logically contiguous aress space although its physical aresses are throughout physical memory Units of Memory an Backing Store Physical memory is ivie into fixe-size blocks calle frames. The logical memory space of each process is ivie into blocks of the same size calle pages. The backing store is also ivie into blocks of the same size if use.

15 Paging Basic Metho Page Offset Logical Aress CPU p f f Page Table Physical Aress Page Number p.. f Base Aress of Page p Paging Basic Metho p m-n Aress Translation page size page offset m n max number of pages: 2 m-n Logical Aress Space: 2 m Physical Aress Space:??? A page size tens to be a power of 2 for efficient aress translation. The actual page size epens on the computer architecture. Toay, it is from 512B or 16KB.

16 Paging Basic Metho Page A B C D Logical Memory Logical Aress 1 * = Page Table C D A B Frame Physical Memory Physical Aress = 6 * = 25 Paging Basic Metho No External Fragmentation Paging is a form of ynamic relocation. The average internal fragmentation is about one- half page per process The page size generally grows over time as processes, ata sets, an memory have become larger. 4-byte page table entry & 4KB per page 2 32 * 2 12 B = 2 44 B = 16TB of physical memory Page Size Disk I/O Efficiency Page Table Maintenance * Example: 8KB or 4KB for Solaris. Internal Fragmentation

17 Paging Basic Metho Page Replacement: An executing process has all of its pages in physical memory. Maintenance of the Frame Table One entry for each physical frame The status of each frame (free or allocate) an its owner The page table of each process must be save when the process is preempte. Paging increases context-switch time! Paging Harware Support Page Tables Where: Registers or Memory Efficiency is the main consieration! The use of registers for page tables The page table must be small! The use of memory for page tables Page-Table a Base Register A Page(PTBR) Table

18 Paging Harware Support Page Tables on Memory Avantages: The size of a page table is unlimite! The context switch cost may be low if the CPU ispatcher merely changes PTBR, instea of reloaing another page table. Disavantages: Memory access is slowe by a factor of 2 Translation Look-asie buffers (TLB) Associative, high-spee memory (key/tag, value) 16 ~ 1024 entries Less than 10% memory access time Paging Harware Support Translation Look-asie Buffers(TLB): Disavantages: Expensive Harware an Flushing of Contents for Switching of Page Tables Avantage: Fast Constant-Search Time key value item

19 Paging Harware Support Logical Aress CPU p Page# Frame# p. TLB Miss * Aress-Space Ientifiers (ASID) in TLB for process matching? Protection? Flush? TLB.. f Page Table TLB Hit f Physical Aress Physical Memory Upate TLB if a TLB miss occurs! Replacement of TLB entries might be neee. Paging Effective Memory Access Time Hit Ratio = the percentage of times that a page number is foun in the TLB The hit ratio of a TLB largely epens on the size an the replacement strategy of TLB entries! Effective Memory Access Time Hit-Ratio * (TLB lookup + a mappe memory access) + (1 Hit-Ratio) * (TLB lookup + a page table lookup + a mappe memory access)

20 Paging Effective Memory Access Time An Example 20ns per TLB lookup, 100ns per memory access Effective Access Time = 0.8*120ns +0.2*220ns = 140 ns, when hit ratio = 80% Effective access time = 0.98*120ns +0.02*220ns = 122 ns, when hit ratio = 98% Intel 486 has a 32-register TLB an claims a 98 percent hit ratio. Paging Protection & Sharing Protection y v 2 y v 7 y 3 Page Table Is the page in memory? y v 1 0 Vali-Invali Bit Vali Page? Moifie? r/w/e protecte: 100r, 010w, 110rw, memory r/w/e irty Use a Page-Table Length Register (PTLR) to inicate the size of the page table. Unuse Page table entries might be ignore uring maintenance.

21 0 2K 4K 8K 10K 10,468 12,287 Paging Protection & Sharing Example: a byte Process (16384=2 14 6K P0 P1 P2 P3 P4 P5 Logical aress p V 2 V 3 V 4 V 7 V 8 V 9 i 0 i 0 Page Table (PTLR entries?) P0 P1 P2 P3 P4 P5 14 ) P1 Paging Protection & Sharing *e1 *e2 *e3 * Data 1 Page Table P2 *e1 *e2 *e3 * Data 2 Page Table * ata1 * * e1 * * e2 * * e3 * ata2 :: page n Proceures which are execute often (e.g., eitor) can be ivie into proceure + ate. Memory can be save a lot. Reentrant proceures can be save! The non-moifie nature of save coe must be enforce Aress referencing insie share pages coul be an issue.

22 Multilevel Paging Motivation The logical aress space of a process in many moern computer system is very large, e.g., 2 32 to 2 64 Bytes. 32-bit aress 2 20 page entries 4MB 4KB per page 4B per entries page table Even the page table must be ivie into pieces to fit in the memory! Multilevel Paging Two-Level Paging Logical Aress P1 P2 P1 Physical Memory P2 PTBR Outer-Page Table A page of page table Forwar-Mappe Page Table

23 Multilevel Paging N-Level Paging P 1 Motivation: Two-level paging is not appropriate for a huge logical aress space! Logical Aress P 2.. P n PTBR N pieces P1 P2 Pn Physical Memory = n+1 accesses Multilevel Paging N-Level Paging Example 98% hit ratio, 4-level 4 paging, 20ns TLB access time, 100ns memory access time. Effective access time = 0.98 X 120ns X 520ns = 128ns SUN SPARC (32-bit aressing) 3- level paging Motorola (32-bit aressing) 4- level paging VAX (32-bit aressing) 2-level paging

24 Hashe Page Tables Objective: To hanle large aress spaces Virtual aress hash function a linke list of elements (virtual page #, frame #, a pointer) Clustere Page Tables Each entry contains the mappings for several physical-page page frames, e.g., 16. Inverte Page Table Motivation A page table tens to be big an oes not correspon to the # of pages resiing in the physical memory. Each entry correspons to a physical frame. Virtual Aress: <Process ID, Page Number, Offset> CPU Logical Aress pi P f Physical Memory pi: p Physical Aress An Inverte Page Table

25 Inverte Page Table Each entry contains the virtual aress of the frame. Entries are sorte by virtual aresses. One table per system. When no match is foun, the page table of the corresponing process must be reference. Example Systems: HP Spectrum, IBM RT, PowerPC, SUN UltraSPARC CPU Logical Aress pi P pi: p An Inverte Page Table f Physical Aress Physical Memory Inverte Page Table Avantage Decrease the amount of memory neee to store each page table Disavantage The inverte page table is sorte by virtual aresses. The use of Hash Table to eliminate lengthy table lookup time: 1HASH + 1IPT The use of an associative memory to hol recently locate entries. Difficult to implement with share memory

26 Segmentation Segmentation is a memory management scheme that support the user view of memory: A logical aress space is a collection of segments with variable lengths. Subroutine Stack Sqrt Symbol table Main program Segmentation Why Segmentation? Paging separates the user s s view of memory from the actual physical memory but oes not reflect the logical units of a process! Pages & frames are fixe-size, but segments have variable sizes. For simplicity of representation, <segment name, offset> <segment-number, number, offset>

27 Segmentation Harware Support Aress Mapping CPU s s limit base limit Segment Table base < no yes + Physical Memory trap Segmentation Harware Support Implementation in Registers limite size! Implementation in Memory Segment-table table base register (STBR) Segment-table table length register (STLR) Avantages & Disavantages Paging Use an associative memory (TLB) to improve the effective memory access time! TLB must be flushe whenever a new segment table is use! a STBR Segment table STLR

28 Segmentation Protection & Sharing Avantage: Segments are a semantically efine portion of the program an likely to have all entries being homogeneous. Example: Array, coe, stack, ata, etc. Logical units for protection! Sharing of coe & ata improves memory usage. Sharing occurs at the segment level. Segmentation Protection & Sharing Potential Problems External Fragmentation Segments must occupy contiguous memory. Aress referencing insie share segments can be a big issue: Seg offs # et Inirect aressing?!!! Shoul all share-coe segments have the same segment number? How to fin the right segment number if the number of users sharing the segments increase! Avoi reference to segment #

29 Segmentation Fragmentation Motivation: Segments are of variable lengths! Memory allocation is a ynamic storage-allocation allocation problem. best-fit? first-fit? fit? worst-ft? External fragmentation will occur!! Factors, e.g., average segment sizes Size External Fragmentation A byte Overheas increases substantially! (base+limit registers ) Segmentation Fragmentation Remark: Its external fragmentation problem is better than that of the ynamic partition metho because segments are likely to be smaller than the entire process. Internal Fragmentation??

30 Segmentation with Paging Motivation : Segmentation has external fragmentation. Paging has internal fragmentation. Segments are semantically efine portions of a program. Page Segments! Page Segmentation Intel K Private Segments + 8K Public Segments Page Size = 4KB, Max Segment Size = 4GB Tables: Local Descriptor Table (LDT) Global Descriptor Table (GDT) 6 microprogram segment registers for caching Logical Aress Selector s g p Linear Aress Segment Offset p1 10 s 32 p

31 Page Segmentation Intel Logical Aress s+g+p s Descriptor Table : Segment Length : : Segme nt Base : >- Trap no f Physical aress Page Directory Base Register Physical Memory Segment table p1 ; p2 ; p1 *Page table are limite by the segment lengths of their segments. p2 Page Directory f Page Table Paging an Segmentation To overcome isavantages of paging or segmentation alone: Page segments ivie segments further into pages. Segment nee not be in contiguous memory. Segmente paging segment the page table. Variable size page tables. Aress translation overheas increase! An entire process still nees to be in memory at once! Virtual Memory!!

32 Paging an Segmentation Consierations in Memory Management Harware Support, e.g., STBR, TLB, etc. Performance Fragmentation Multiprogramming Levels Relocation Constraints? Swapping: + Sharing?! Protection?!

Chapter 9 Memory Management

Chapter 9 Memory Management Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

More information

Overview. Operating Systems I. Simple Memory Management. Simple Memory Management. Multiprocessing w/fixed Partitions.

Overview. Operating Systems I. Simple Memory Management. Simple Memory Management. Multiprocessing w/fixed Partitions. Overview Operating Systems I Management Provie Services processes files Manage Devices processor memory isk Simple Management One process in memory, using it all each program nees I/O rivers until 96 I/O

More information

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition Chapter 7: Main Memory Operating System Concepts Essentials 8 th Edition Silberschatz, Galvin and Gagne 2011 Chapter 7: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure

More information

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts Memory management Last modified: 26.04.2016 1 Contents Background Logical and physical address spaces; address binding Overlaying, swapping Contiguous Memory Allocation Segmentation Paging Structure of

More information

Module 8: Memory Management

Module 8: Memory Management Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts 8.1 Silberschatz and Galvin

More information

Chapter 8: Memory-Management Strategies

Chapter 8: Memory-Management Strategies Chapter 8: Memory-Management Strategies Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and

More information

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed. CHAPTER 8: MEMORY MANAGEMENT By I-Chen Lin Textbook: Operating System Concepts 9th Ed. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the

More information

CS307: Operating Systems

CS307: Operating Systems CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn

More information

Chapter 8: Main Memory. Operating System Concepts 9 th Edition

Chapter 8: Main Memory. Operating System Concepts 9 th Edition Chapter 8: Main Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel

More information

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES OBJECTIVES Detailed description of various ways of organizing memory hardware Various memory-management techniques, including paging and segmentation To provide

More information

Logical versus Physical Address Space

Logical versus Physical Address Space CHAPTER 8: MEMORY MANAGEMENT Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts, Addison-Wesley 1994

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and 64-bit Architectures Example:

More information

Module 8: Memory Management

Module 8: Memory Management Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.1 Background Program must be brought into memory

More information

Module 9: Memory Management. Background. Binding of Instructions and Data to Memory

Module 9: Memory Management. Background. Binding of Instructions and Data to Memory Module 9: Memory Management Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 9.1 Background Program must be brought into memory

More information

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation

More information

Chapter 8 Main Memory

Chapter 8 Main Memory COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 8 Main Memory Zhi Wang Florida State University Contents Background Swapping Contiguous memory allocation Paging Segmentation OS examples

More information

Chapter 9: Memory Management. Background

Chapter 9: Memory Management. Background 1 Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 9.1 Background Program must be brought into memory and placed within a process for

More information

Memory Management. CSCI 315 Operating Systems Design Department of Computer Science

Memory Management. CSCI 315 Operating Systems Design Department of Computer Science Memory Management CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture are based on those from Operating Systems Concepts, 9th ed., by Silberschatz, Galvin,

More information

Chapter 8 Memory Management

Chapter 8 Memory Management Chapter 8 Memory Management Da-Wei Chang CSIE.NCKU Source: Abraham Silberschatz, Peter B. Galvin, and Greg Gagne, "Operating System Concepts", 9th Edition, Wiley. 1 Outline Background Swapping Contiguous

More information

Part Three - Memory Management. Chapter 8: Memory-Management Strategies

Part Three - Memory Management. Chapter 8: Memory-Management Strategies Part Three - Memory Management Chapter 8: Memory-Management Strategies Chapter 8: Memory-Management Strategies 8.1 Background 8.2 Swapping 8.3 Contiguous Memory Allocation 8.4 Segmentation 8.5 Paging 8.6

More information

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management Part Four - Memory Management 8.1 Background Chapter 8: Memory-Management Management Strategies Program must be brought into memory and placed within a process for it to be run Input queue collection of

More information

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation

More information

Chapter 8: Memory- Management Strategies

Chapter 8: Memory- Management Strategies Chapter 8: Memory Management Strategies Chapter 8: Memory- Management Strategies Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and

More information

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure. File Systems I/O Management Hard Drive Management Virtual Memory Swap Memory Management Storage and I/O Introduction CSI3131 Topics Process Management Computing Systems Memory CPU Peripherals Processes

More information

Chapter 8: Memory Management

Chapter 8: Memory Management Chapter 8: Memory Management Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.2 Background Program must be brought into memory and placed

More information

Memory Management. Memory Management

Memory Management. Memory Management Memory Management Gordon College Stephen Brinton Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 1 Background Program must be brought into memory

More information

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s Chapter 8: Memory- Management Strategies Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 2009/12/16

More information

I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY

I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY MANAGEMENT Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009! Chapter 8: Memory Management Background" Swapping " Contiguous Memory Allocation" Paging" Structure

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 8.2 Silberschatz, Galvin

More information

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY MANAGEMENT Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the

More information

CS307 Operating Systems Main Memory

CS307 Operating Systems Main Memory CS307 Main Memory Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2018 Background Program must be brought (from disk) into memory and placed within a process

More information

Chapter 8: Memory Management Strategies

Chapter 8: Memory Management Strategies Chapter 8: Memory- Management Strategies, Silberschatz, Galvin and Gagne 2009 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table

More information

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1 Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1 Chapter 9: Memory Management Background Swapping Contiguous Memory Allocation Segmentation

More information

Memory Management. Contents: Memory Management. How to generate code? Background

Memory Management. Contents: Memory Management. How to generate code? Background TDIU11 Operating systems Contents: Memory Management Memory Management [SGG7/8/9] Chapter 8 Background Relocation Dynamic loading and linking Swapping Contiguous Allocation Paging Segmentation Copyright

More information

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 1 Background Memory management is crucial in better utilizing one of the most important

More information

Main Memory. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & APPS 1

Main Memory. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & APPS 1 Main Memory Electrical and Computer Engineering Stephen Kim (dskim@iupui.edu) ECE/IUPUI RTOS & APPS 1 Main Memory Background Swapping Contiguous allocation Paging Segmentation Segmentation with paging

More information

CS 3733 Operating Systems:

CS 3733 Operating Systems: CS 3733 Operating Systems: Topics: Memory Management (SGG, Chapter 08) Instructor: Dr Dakai Zhu Department of Computer Science @ UTSA 1 Reminders Assignment 2: extended to Monday (March 5th) midnight:

More information

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium Main Memory Outlook Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 2 Backgound Background So far we considered how to share

More information

Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation

Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Basic Hardware Address Binding Logical VS Physical Address Space Dynamic Loading Dynamic Linking and Shared

More information

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2 6 - Main Memory EECE 315 (101) ECE UBC 2013 W2 Acknowledgement: This set of slides is partly based on the PPTs provided by the Wiley s companion website (including textbook images, when not explicitly

More information

Lecture 8 Memory Management Strategies (chapter 8)

Lecture 8 Memory Management Strategies (chapter 8) Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 8 Memory Management Strategies (chapter 8) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The

More information

CS6401- Operating System UNIT-III STORAGE MANAGEMENT

CS6401- Operating System UNIT-III STORAGE MANAGEMENT UNIT-III STORAGE MANAGEMENT Memory Management: Background In general, to rum a program, it must be brought into memory. Input queue collection of processes on the disk that are waiting to be brought into

More information

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Chapter 8 & Chapter 9 Main Memory & Virtual Memory Chapter 8 & Chapter 9 Main Memory & Virtual Memory 1. Various ways of organizing memory hardware. 2. Memory-management techniques: 1. Paging 2. Segmentation. Introduction Memory consists of a large array

More information

Principles of Operating Systems

Principles of Operating Systems Principles of Operating Systems Lecture 18-20 - Main Memory Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian, and

More information

Memory and multiprogramming

Memory and multiprogramming Memory and multiprogramming COMP342 27 Week 5 Dr Len Hamey Reading TW: Tanenbaum and Woodhull, Operating Systems, Third Edition, chapter 4. References (computer architecture): HP: Hennessy and Patterson

More information

Main Memory Yi Shi Fall 2017 Xi an Jiaotong University

Main Memory Yi Shi Fall 2017 Xi an Jiaotong University Main Memory Yi Shi Fall 2017 Xi an Jiaotong University Goals Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Background Program must be brought (from disk)

More information

Memory Management. Dr. Yingwu Zhu

Memory Management. Dr. Yingwu Zhu Memory Management Dr. Yingwu Zhu Big picture Main memory is a resource A process/thread is being executing, the instructions & data must be in memory Assumption: Main memory is infinite Allocation of memory

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

SHANDONG UNIVERSITY 1

SHANDONG UNIVERSITY 1 Chapter 8 Main Memory SHANDONG UNIVERSITY 1 Contents Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium SHANDONG UNIVERSITY 2 Objectives

More information

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit Memory Management All data in memory before and after processing All instructions in memory in order to execute Memory management determines what is to be in memory Memory management activities Keeping

More information

Goals of Memory Management

Goals of Memory Management Memory Management Goals of Memory Management Allocate available memory efficiently to multiple processes Main functions Allocate memory to processes when needed Keep track of what memory is used and what

More information

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358 Memory Management Reading: Silberschatz chapter 9 Reading: Stallings chapter 7 1 Outline Background Issues in Memory Management Logical Vs Physical address, MMU Dynamic Loading Memory Partitioning Placement

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 L17 Main Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Was Great Dijkstra a magician?

More information

Chapter 8: Memory Management

Chapter 8: Memory Management Chapter 8: Memory Management Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.2 Silberschatz, Galvin and Gagne 2005 Background Program/Code

More information

Memory Management Cache Base and Limit Registers base limit Binding of Instructions and Data to Memory Compile time absolute code Load time

Memory Management Cache Base and Limit Registers base limit Binding of Instructions and Data to Memory Compile time absolute code Load time Memory Management To provide a detailed description of various ways of organizing memory hardware To discuss various memory-management techniques, including paging and segmentation To provide a detailed

More information

Memory Management. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Memory Management. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University. Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Topics Covered Introduction Memory Allocation and Fragmentation Address Translation Paging

More information

Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University

Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Topics Covered Introduction Memory Allocation and Fragmentation Address Translation Paging

More information

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University Main Memory CISC3595, Spring 2015 X. Zhang Fordham University 1 Memory Management! Background!! Contiguous Memory Allocation!! Paging!! Structure of the Page Table!! Segmentation!! Example: The Intel Pentium

More information

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition Chapter 8: Memory Management 8.1 Silberschatz, Galvin and Gagne 2009 Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are

More information

Background. Contiguous Memory Allocation

Background. Contiguous Memory Allocation Operating System Lecture 8 2017.5.9 Chapter 8 (Main Memory) Background Swapping Contiguous Memory Allocation Segmentation - Paging Memory Management Selection of a memory-management method for a specific

More information

Operating Systems. 09. Memory Management Part 1. Paul Krzyzanowski. Rutgers University. Spring 2015

Operating Systems. 09. Memory Management Part 1. Paul Krzyzanowski. Rutgers University. Spring 2015 Operating Systems 09. Memory Management Part 1 Paul Krzyzanowski Rutgers University Spring 2015 March 9, 2015 2014-2015 Paul Krzyzanowski 1 CPU Access to Memory The CPU reads instructions and reads/write

More information

CS3600 SYSTEMS AND NETWORKS

CS3600 SYSTEMS AND NETWORKS CS3600 SYSTEMS AND NETWORKS SPRING 2013 Lecture 13: Paging Prof. Alan Mislove (amislove@ccs.neu.edu) Paging Physical address space of a process can be noncontiguous; process is allocated physical memory

More information

Memory management: outline

Memory management: outline Memory management: outline Concepts Swapping Paging o Multi-level paging o TLB & inverted page tables 1 Memory size/requirements are growing 1951: the UNIVAC computer: 1000 72-bit words! 1971: the Cray

More information

Memory management: outline

Memory management: outline Memory management: outline Concepts Swapping Paging o Multi-level paging o TLB & inverted page tables 1 Memory size/requirements are growing 1951: the UNIVAC computer: 1000 72-bit words! 1971: the Cray

More information

Main Memory (Part II)

Main Memory (Part II) Main Memory (Part II) Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Main Memory 1393/8/17 1 / 50 Reminder Amir H. Payberah

More information

CS399 New Beginnings. Jonathan Walpole

CS399 New Beginnings. Jonathan Walpole CS399 New Beginnings Jonathan Walpole Memory Management Memory Management Memory a linear array of bytes - Holds O.S. and programs (processes) - Each cell (byte) is named by a unique memory address Recall,

More information

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University CSC 4103 - Operating Systems Spring 2007 Lecture - XII Main Memory - II Tevfik Koşar Louisiana State University March 8 th, 2007 1 Roadmap Dynamic Loading & Linking Contiguous Memory Allocation Fragmentation

More information

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems Instructor: Dr. Turgay Korkmaz Department Computer Science The University of Texas at San Antonio Office: NPB

More information

12: Memory Management

12: Memory Management 12: Memory Management Mark Handley Address Binding Program goes through multiple steps from compilation to execution. At some stage, addresses in the program must be bound to physical memory addresses:

More information

6.823 Computer System Architecture. Problem Set #3 Spring 2002

6.823 Computer System Architecture. Problem Set #3 Spring 2002 6.823 Computer System Architecture Problem Set #3 Spring 2002 Stuents are strongly encourage to collaborate in groups of up to three people. A group shoul han in only one copy of the solution to the problem

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 20 Main Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Pages Pages and frames Page

More information

Memory Management. Memory

Memory Management. Memory Memory Management These slides are created by Dr. Huang of George Mason University. Students registered in Dr. Huang s courses at GMU can make a single machine readable copy and print a single copy of

More information

COSC Operating Systems Design, Fall 2001, Byunggu Yu. Chapter 9 Memory Management (Lecture Note #8) 1. Background

COSC Operating Systems Design, Fall 2001, Byunggu Yu. Chapter 9 Memory Management (Lecture Note #8) 1. Background COSC4740 01 Operating Systems Design, Fall 2001, Byunggu Yu Chapter 9 Memory Management (Lecture Note #8) 1. Background The computer programs, together with the data they access, must be in main memory

More information

Unit-03 Deadlock and Memory Management Unit-03/Lecture-01

Unit-03 Deadlock and Memory Management Unit-03/Lecture-01 1 Unit-03 Deadlock and Memory Management Unit-03/Lecture-01 The Deadlock Problem 1. A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.

More information

Last Class: Deadlocks. Where we are in the course

Last Class: Deadlocks. Where we are in the course Last Class: Deadlocks Necessary conditions for deadlock: Mutual exclusion Hold and wait No preemption Circular wait Ways of handling deadlock Deadlock detection and recovery Deadlock prevention Deadlock

More information

Multilevel Paging. Multilevel Paging Translation. Paging Hardware With TLB 11/13/2014. CS341: Operating System

Multilevel Paging. Multilevel Paging Translation. Paging Hardware With TLB 11/13/2014. CS341: Operating System CS341: Operating System Lect31: 21 st Oct 2014 Dr A Sahu Dept o Comp Sc & Engg Inian Institute o Technology Guwahati ain Contiguous Allocation, Segmentation, Paging Page Table an TLB Paging : Larger Page

More information

P r a t t hr h ee e : e M e M m e o m r o y y M a M n a a n g a e g m e e m n e t 8.1/72

P r a t t hr h ee e : e M e M m e o m r o y y M a M n a a n g a e g m e e m n e t 8.1/72 Part three: Memory Management programs, together with the data they access, must be in main memory (at least partially) during execution. the computer keeps several processes in memory. Many memory-management

More information

Memory Management (Chaper 4, Tanenbaum)

Memory Management (Chaper 4, Tanenbaum) Memory Management (Chaper 4, Tanenbaum) Memory Mgmt Introduction The CPU fetches instructions and data of a program from memory; therefore, both the program and its data must reside in the main (RAM and

More information

Operating System 1 (ECS-501)

Operating System 1 (ECS-501) Operating System 1 (ECS-501) Unit- IV Memory Management 1.1 Bare Machine: 1.1.1 Introduction: It has the ability to recover the operating system of a machine to the identical state it was at a given point

More information

Memory Management. Frédéric Haziza Spring Department of Computer Systems Uppsala University

Memory Management. Frédéric Haziza Spring Department of Computer Systems Uppsala University Memory Management Frédéric Haziza Department of Computer Systems Uppsala University Spring 2008 Operating Systems Process Management Memory Management Storage Management Compilers Compiling

More information

Memory Management. Dr. Yingwu Zhu

Memory Management. Dr. Yingwu Zhu Memory Management Dr. Yingwu Zhu Big picture Main memory is a resource A process/thread is being executing, the instructions & data must be in memory Assumption: Main memory is super big to hold a program

More information

9.1 Background. In Chapter 6, we showed how the CPU can be shared by a set of processes. As a result of

9.1 Background. In Chapter 6, we showed how the CPU can be shared by a set of processes. As a result of Chapter 9 MEMORY MANAGEMENT In Chapter 6, we showed how the CPU can be shared by a set of processes. As a result of CPU scheduling, we can improve both the utilization of the CPU and the speed of the computer's

More information

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory Multi-Process Systems: Memory (2) What we will learn A detailed description of various ways of organizing memory Discuss various memory-management techniques, including paging and segmentation To provide

More information

Today: Segmentation. Last Class: Paging. Costs of Using The TLB. The Translation Look-aside Buffer (TLB)

Today: Segmentation. Last Class: Paging. Costs of Using The TLB. The Translation Look-aside Buffer (TLB) Last Class: Paging Process generates virtual addresses from 0 to Max. OS divides the process onto pages; manages a page table for every process; and manages the pages in memory Hardware maps from virtual

More information

Operating Systems Memory Management. Mathieu Delalandre University of Tours, Tours city, France

Operating Systems Memory Management. Mathieu Delalandre University of Tours, Tours city, France Operating Systems Memory Management Mathieu Delalandre University of Tours, Tours city, France mathieu.delalandre@univ-tours.fr 1 Operating Systems Memory Management 1. Introduction 2. Contiguous memory

More information

Chapter 8: Main Memory. Operating System Concepts 8th Edition

Chapter 8: Main Memory. Operating System Concepts 8th Edition Chapter 8: Main Memory Operating System Concepts 8th Edition Silberschatz, Galvin and Gagne 2009 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page

More information

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses. 1 Memory Management Address Binding The normal procedures is to select one of the processes in the input queue and to load that process into memory. As the process executed, it accesses instructions and

More information

Memory Management (Chaper 4, Tanenbaum)

Memory Management (Chaper 4, Tanenbaum) Memory Management (Chaper 4, Tanenbaum) Copyright 1996 25 Eskicioglu and Marsland (and Prentice-Hall and Paul Lu) Memory Mgmt Introduction The CPU fetches instructions and data of a program from memory;

More information

Operating Systems. Memory Management. Lecture 9 Michael O Boyle

Operating Systems. Memory Management. Lecture 9 Michael O Boyle Operating Systems Memory Management Lecture 9 Michael O Boyle 1 Memory Management Background Logical/Virtual Address Space vs Physical Address Space Swapping Contiguous Memory Allocation Segmentation Goals

More information

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it to be run Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester Mono-programming

More information

Introduction to Operating Systems

Introduction to Operating Systems Introduction to Operating Systems Lecture 6: Memory Management MING GAO SE@ecnu (for course related communications) mgao@sei.ecnu.edu.cn Apr. 22, 2015 Outline 1 Issues of main memory 2 Main memory management

More information

Main Memory CHAPTER. Exercises. 7.9 Explain the difference between internal and external fragmentation. Answer:

Main Memory CHAPTER. Exercises. 7.9 Explain the difference between internal and external fragmentation. Answer: 7 CHAPTER Main Memory Exercises 7.9 Explain the difference between internal and external fragmentation. a. Internal fragmentation is the area in a region or a page that is not used by the job occupying

More information

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those from an earlier edition of the course text Operating

More information

Memory Management and Protection

Memory Management and Protection Part IV Memory Management and Protection Sadeghi, Cubaleska RUB 2008-09 Course Operating System Security Memory Management and Protection Main Memory Virtual Memory Roadmap of Chapter 4 Main Memory Background

More information

Chapters 9 & 10: Memory Management and Virtual Memory

Chapters 9 & 10: Memory Management and Virtual Memory Chapters 9 & 10: Memory Management and Virtual Memory Important concepts (for final, projects, papers) addressing: physical/absolute, logical/relative/virtual overlays swapping and paging memory protection

More information

CSE 4/521 Introduction to Operating Systems. Lecture 14 Main Memory III (Paging, Structure of Page Table) Summer 2018

CSE 4/521 Introduction to Operating Systems. Lecture 14 Main Memory III (Paging, Structure of Page Table) Summer 2018 CSE 4/521 Introduction to Operating Systems Lecture 14 Main Memory III (Paging, Structure of Page Table) Summer 2018 Overview Objective: To discuss how paging works in contemporary computer systems. Paging

More information

Main Memory (II) Operating Systems. Autumn CS4023

Main Memory (II) Operating Systems. Autumn CS4023 Operating Systems Autumn 2017-2018 Outline 1 Main Memory (II) Outline Main Memory (II) 1 Main Memory (II) Paging Main Memory (II) Physical address space of a process can be noncontiguous; process is allocated

More information

Operating Systems Unit 6. Memory Management

Operating Systems Unit 6. Memory Management Unit 6 Memory Management Structure 6.1 Introduction Objectives 6.2 Logical versus Physical Address Space 6.3 Swapping 6.4 Contiguous Allocation Single partition Allocation Multiple Partition Allocation

More information