Chapter 3 Memory Management: Virtual Memory

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Chapter 3 Memory Management: Virtual Memory"

Transcription

1 Memory Management Where we re going Chapter 3 Memory Management: Virtual Memory Understanding Operating Systems, Fourth Edition Disadvantages of early schemes: Required storing entire program in memory Fragmentation Overhead due to relocation Evolution of virtual memory helps to: Remove the restriction of storing programs contiguously Eliminate the need for entire program to reside in memory during execution First we have to cover some background material Virtual Memory Objectives You will be able to describe: The basic functionality of the memory allocation methods covered in this chapter: paged, demand paging, segmented, and segmented/demand paged memory allocation The influence that these page allocation methods have had on virtual memory The difference between a first-in first-out page replacement policy, a least-recently-used page replacement policy, and a clock page replacement policy The mechanics of paging and how a memory allocation scheme determines which pages should be swapped out of memory The concept of the working set and how it is used in memory allocation schemes The impact that virtual memory had on multiprogramming Cache memory and its role in improving system response time 1 2

2 # inc JOB Page 0 Paged Memory Allocation Compiler Memory Manager OS OS RAM Page Frame 99 Page Frame 100 Paged Memory Allocation (continued) Page 4 Page 5 H/D 6 sectors Page Frame 123 Note: This scheme works well when sectors, pages and page frames are the same size Paged memory allocation scheme for a job of 350 lines. Notice pages are not required to be in adjacent blocks Paged Memory Allocation In this scheme the compiler divides the job into a number of pages. In this example the job can be broken into 6 pages. Even if the job only required 5 + a bit pages its allocated 6 pages (i.e. nearest round number) Its subsequently stored on six sectors of H/D. (I m assuming that the disk sector size matches the job page size). Later the OS memory manager loads the job into 6 page frames of RAM. The OS will probably not be able to load the jobs into 6 contiguous pages. Equally it doesn t worry about them being in order; Page 5 could be loaded into memory before Page 1 if it was read of the H/D first. This scheme works well if page size, memory block size (page frames), and size of disk section (sector, block) are all equal. Before executing a program, Memory Manager: Determines number of pages in program Locates enough empty page frames in main memory Loads all of the program s pages into them 3 4

3 Benefits - Problems Memory usage is more efficient An empty page frame can be used by any page of any job No compaction required However we need to keep track of where each job s pages are in memory. We still have entire job in memory Job1 Job2 Job3 Job Table Page Map Table Memory Map Table Memory Manager s Tables 1 1 JT address where Job1 s PMT is in memory Actual Address 0x MMT 0x074 Job1 page 2 held in page frame PMT 0x mapped Stored or calculated with some Math in H/W memory-address = page-frame-num* bytes-per-page-frame Memory Manager requires three tables to keep track of the job s pages: Job Table (JT) contains information about; Size of the job Memory location where its PMT is stored Typically the JT is placed into a special register in the CPU by the OS when the job is selected to run. The memory manager HW then has the address of the PMT (held in RAM) for this job. Page Map Table (PMT) The job assumes its pages are all in memory and all stored from page 0 to page XX in an orderly manner. In reality the pages are stored in real RAM page frames. So the PMT is really a cross ref between a page number and its corresponding page frame memory number. This is essentially an index into the MMT. Which will tell us where the page really is. Memory Map Table (MMT) contains; Location for each page frame could be stored in MMT or it could simply be calculated using H/W. The math is: memory-address = page-framenumber* bytes-per-page-frame 5 Mapped/Unmapped status (whether this page is in RAM or still on the H/D) 6

4 Memory Map Table Hardware Aside Lives in RAM and is accessed by the MMU Updated/modified by the OS Memory Map tables can be extremely large Consider 32 bit machines which can address 4GB of memory 2 32 = 4GB address space with 4-KB page size => 1 million pages That means a table with 1-million entries Note: On the new 64 bit machines the (e.g. Linux) kernel supports a larger 2 million GB address space!! Large, fast page mapping is a constraint on modern computers» This describes the mapping from virtual-tophysical address mappings 7 8

5 Tanenbaum section Tanenbaum section A brief look at the H/W: MMU and TLB Internals of the MMU /2 6 6 Present/Absent bit PMT MMT bits allows us to access all 4096 bytes within a page 1 1 More over Number of page frame Page number Offset in that page

6 Paged Memory Allocation (continued) Page size = 100 Finish Hardware Aside Page number 1 Contains first 100 lines Displacement Describes how far away a line if from start of page-frame Displacement (offset) of a line: Determines how far away a line is from the beginning of its page Used to locate that line within its page frame How to determine page number and displacement of a line: Page number = the integer quotient from the division of the job space address by the page size Displacement = the remainder from the page number division 11 12

7 Paged Memory Allocation (continued) But you said earlier that the pages could be any where in memory so where is Page 2? (1) Consult the Page Map Table for this job CPU executes line 203. How does it now find line 204 in RAM to execute it? page number page size required line number xxx xxx xxx displacement page number displacement But... -> Steps to determine exact location of a line in memory: Determine page number and displacement of a line Refer to the job s PMT and find out which page frame contains the required page Get the address of the beginning of the page frame by multiplying the page frame number by the page frame size Add the displacement (calculated in step 1) to the starting address of the page frame Or Refer to the job s PMT and find out where in memory that page is located (as next slide) Add the displacement (calculated in step 1) to the starting address of the page frame The math here is actually carried out in H/W and the OS (memory manager is responsible for remembering the info ) 13 14

8 Exercise 1 MB System RAM with page frame size of 512 Bytes Job 1 has 680 lines of code One byte per instruction (or data value). 512 byte page size The current line being executed by the CPU in Job 1 is line 25 : LOAD R1, 518 //Load value at memory location 518 into register 1 Job 1 : Page Map Table Page no. Page Frame Num Question What address in RAM is memory location 518 mapped to? Answer Line 518 must be in second page (512 bytes per page) Page number 1 is stored in RAM page frame is displaced by 6 from the start of page number 1 (i.e (per page) = 6) RAM page frame 5 is at location (6* 512) = 3072 (remember page frame number 5 is the 6 th page frame) We must displace by 6 => Its at memory location 3078 Therefore memory location 3078 holds the value that must be stored in Register

9 Paged Memory Allocation (continued) Advantages: Allows jobs to be allocated in non-contiguous memory locations Memory used more efficiently; more jobs can fit Disadvantages: Address resolution causes increased overhead Internal fragmentation still exists, though in last page Requires the entire job to be stored in memory location Size of page is crucial (not too small, not too large) Next... Demand Paging 17 18

10 Next step on the way to VM: Demand Paging Pages are brought into memory only as they are needed Programs are written sequentially so not all pages are necessary at once. For example: User-written error handling modules Mutually exclusive modules Options are not always accessible Demand Paging (continued) Demand paging made virtual memory widely available (More later..) More jobs with less main memory Needs high-speed direct access storage device Predefined policies How and when the pages are passed (or swapped ) Demand Paging: Pages are brought into memory only as they are needed, allowing jobs to be run with less main memory Takes advantage that programs are written sequentially so not all pages are necessary at once. For example: User-written error handling modules are processed only when a specific error is detected Error might not occur etc Mutually exclusive modules Can t do input and do CPU work for a module at the same time Certain program options are not always accessible Can t open file and edit its contents at the same time Demand paging made virtual memory widely available Can give appearance of an almost infinite or nonfinite amount of physical memory Allows the user to run jobs with less main memory than required in paged memory allocation Requires use of a high-speed direct access storage device that can work directly with CPU How and when the pages are passed (or swapped ) depends on predefined policies that determine when to make room for needed pages and how to do so

11 OS tables revamped What Tanenbaum says is in the PMT (aka Page Table Entries, PKE) 3 new fields! Total job pages are 15, and the number of total available page frames is 12 (OS takes 4) Figure 3.5: A typical demand paging scheme The OS depends on following tables: Job Table Page Map Table with 3 new fields to determine Status: Tells if page is already in memory Modified: If page contents have been modified since last save Referenced: If the page has been referenced recently Used to determine which pages should remain in main memory and which should be swapped out It should make sense that you swap out the least used page. Memory Map Table 21 22

12 Demand Paging (continued) Not enough main memory to hold all the currently active processes? Swapping Process: Paging Example- 1 program thinks it has this much space but the machine only has this much Note: (Virtual) pages and (Real) page frames are the same size, here its 4K (as in the Pentium) but in real systems size ranges from 512bytes to 64KB We have 16 virtual pages and 8 page frames Transfers from RAM to disk are always in units of pages X means that the page is not (currently) mapped to a frame Assume pages (and frames) are counted from 0. To move in a new page, a resident page may have to be swapped back into secondary storage; Swapping involves Copying the resident page to the disk (if it was modified ; no need to save if it wasn t) Writing the new page into the (now) empty page frame Requires close interaction between hardware components, software algorithms, and policy schemes 23 24

13 Paging Example- - 2 Paging Example- - 3 Example Assume a program tries to access address 8192 This address is sent to the MMU The MMU recognizes that this address falls in virtual page 2 (assume pages start at zero) The MMU looks at its page mapping and sees that page 2 maps to physical page 6 The MMU translates 8192 to the relevant address in page frame 6 (this being 24576) This address is output by the MMU and the memory board simply sees a request for address It does not know that the MMU has intervened. The memory board simply sees a request for a particular location, which it honours. MMU frame 6 We have eight virtual pages which do not map to a physical page Each virtual page will have a present/absent bit which indicates if the virtual page is mapped to a physical page Present/Absent bit 25 26

14 Paging Example- 4 What happens if we try to use an unmapped page? For example, the program tries to access address (i.e. 24K) The MMU will notice that the page is unmapped and will cause the CPU to trap to the OS This trap is called a page fault The operating system will decide to evict one of the currently mapped pages and use that for the page that has just been referenced The page that has just been referenced is copied (from disc) to the virtual page that has just been freed. The virtual page frames are updated. The trapped instruction is restarted. Page faults Two reasons why we could/would get a page fault Page fault handler: The section of the operating system that determines Whether there are empty page frames in memory If so, requested page is copied from secondary storage Which page will be swapped out if all page frames are busy Decision is directly dependent on the predefined policy for page removal 27 28

15 Paging Example- 5 Example (trying to access address 24576) (1) The MMU would cause a trap to the operating system as the virtual page is not mapped to a physical location (shown by an X) (2) A virtual page that is mapped is elected for eviction (we ll assume that page 11 is nominated) (2a)Virtual page 11 is mark as unmapped (i.e. the present/absent bit is changed) (3) Physical page 7 is written to disc (we ll assume for now that this needs to be done). That is the physical page that virtual page 11 maps onto (4) Virtual page 6 is loaded to physical address (28K) (5)The entry for virtual page 6 is changed so that the present/absent bit is changed. (5a) Also the X is replaced by a 7 so that it points to the correct physical page When the trapped instruction is re-executed it will now work correctly x To Disk From Disk Demand Paging (continued) Advantages: Job no longer constrained by the size of physical memory (concept of virtual memory) Utilizes memory more efficiently than the previous schemes Disadvantages: Increased overhead caused by the tables and the page interrupts 29 30

16 Demand Paging Problems: Thrashing An excessive amount of page swapping between main memory and secondary storage Operation becomes inefficient Caused when a page is removed from memory but is called back shortly thereafter Can occur across jobs, when a large number of jobs are vying for a relatively few number of free pages Can happen within a job (e.g., in loops that cross page boundaries) How would the OS spot that its going on? Large amount of page faults occur Page fault: a failure to find a page in memory How would the OS eliminate it It may well remove other jobs pages from memory to allocate space for the job that is trashing Page Replacement Policies 31 32

17 Page Replacement Policies and Concepts Policy that selects the page to be removed Crucial to system efficiency. Types include: First-in first-out (FIFO) policy: Removes page that has been in memory the longest Least-recently-used (LRU) policy: Removes page that has been least recently accessed Also Most recently used (MRU) policy Least frequently used (LFU) policy Job Page A Page B Page C Page D FIFO Page Replacement Policy System has only two page frames 1 1 Sequence of page requests in Job A A was first into memory and someone has to make room for C so A has to be first out An interrupt * is generated when a new page needs to be brought into memory. Here we have 9 of 11 (poor) This is an area that enjoys a lot of research activity. FIFO A nice analogy is the new jumper. If you buy a new jumper and you wish to put into your jumper drawer, but you find that its full you could decide to remove your oldest jumper to make room for the newest one LRU You could also decide to remove your least worn jumper to make room for the newest one Here we see that when page C is requested page A is removed from RAM because it was the first page into memory. This concept is analogous to a queue. The person who first to the queue will be at the head of the queue and then will the first one out of the queue. FIFO isn t necessarily bad but this example shows it can have poor performance 9/11 = 82% failure rate (or 18% success rate). FIFO anomaly: No guarantee that buying more memory will always result in better performance 33 34

18 LRU Page Replacement Policy Page Replacement Policies and Concepts (continued) B has only been used two times so it has to leave to make room for C Efficiency (ratio of page interrupts to page requests) is slightly better for LRU as compared to FIFO In LRU case, increasing main memory will cause either decrease in or same number of interrupts An interrupt * is generated when a new page is brought into memory. Here we have 8 of 11 Implementing LRU poilicy (NEXT SLIDE) One mechanism for the LRU uses an 8-bit reference byte and a bit-shifting technique to track the usage of each page currently in memory Here the principle of locality is used. If we recently used a page its likely we will again in the near future 35 36

19 LRU implementation Time 0 each page has the leftmost bit of its reference byte set to 1, all other bits are zero Time moves on For those pages who have been referenced in the previous time interval the bits are right-shifted and the leftmost bit is set to 1; 0 for the others Mechanisms Of Paging After 4 time intervals least used Figure 3.11: Bit-shifting technique in LRU policy 37 38

20 The Mechanics of Paging The memory manager needs info to help it decide who to swap out. Status bit: Indicates if page is currently in memory Referenced bit: Indicates if page has been referenced recently Modified bit: Indicates if page contents have been altered Used to determine if page must be rewritten to secondary storage when it s swapped out Used by the FIFO algorithm Used by the LRU algorithm Q: Which page will LRU swap out? Answer Either of Page 1 or Page 2 as neither have been referenced or modified (so they won t require saving to secondary storage) 39 40

21 The Working Set The Working Set This is an innovation that improved the performance of demand paging schemes. This program needs 120ms to run but 900ms to load the pages into memory! Very wasteful Wouldn t it be great if we could load the useful pages as we picked the program to run = > much quicker execution 41 42

22 Working Set Working set: Set of pages residing in memory that can be accessed directly without incurring a page fault Improves performance of demand page schemes Requires the concept of locality of reference Segmented Memory Allocation To load a working set into memory the system must decide The maximum number of pages the operating system will allow for a working set If this is the first time its run how can it know the working set? Maybe this could be observed as the program is first loaded into memory and then this info is used for its next turn on the CPU 43 44

23 Segmented Memory Allocation Programmers normally decompose their programs into modules With segmented memory allocation each job is divided into several segments of different sizes, one for each module that contains pieces to perform related functions Main memory is no longer divided into page frames, Segments are set up according to the program s structural modules when a program is compiled or assembled Each segment is numbered Segment Map Table (SMT) is generated Segmented Memory Allocation (continued) Figure 3.13: Segmented memory allocation. Job1 includes a main program, Subroutine A, and Subroutine B. It s one job divided into three segments. What we want is for the system to conform to the programmers model of how the program is decomposed into functions/modules. We would like function blocks to be loaded as required to enable different functional parts of the program as required

24 Segmented Memory Allocation (continued) Segmented Memory Allocation (continued) Advantages: Internal fragmentation is removed Disadvantages: Difficulty managing variable-length segments in secondary storage External fragmentation Figure 3.14: The Segment Map Table tracks each segment for Job 1 Memory Manager tracks segments in memory using following three tables: Job Table lists every job in process (one for whole system. Not shown on slide) Segment Map Table lists details about each segment (one for each job) Memory Map Table monitors allocation of main memory (one for whole system) Segments don t need to be stored contiguously The addressing scheme requires segment number and displacement 47 48

25 Segmented/Demand Paged Memory Allocation Subdivides segments into pages of equal size, smaller than most segments, and more easily manipulated than whole segments. It offers: Logical benefits of segmentation Physical benefits of paging Removes the problems of compaction, external fragmentation, and secondary storage handling The addressing scheme requires segment number, page number within that segment, and displacement within that page Segmented/Demand Paged Memory Allocation (continued) This scheme requires following four tables: Job Table lists every job in process (one for the whole system) Segment Map Table lists details about each segment (one for each job) Page Map Table lists details about every page (one for each segment) Memory Map Table monitors the allocation of the page frames in main memory (one for the whole system) 49 50

26 Segmented/Demand Paged Memory Allocation Segmented/Demand Paged Memory Allocation (continued) Advantages: Large virtual memory Segment loaded on demand Disadvantages: Table handling overhead Memory needed for page and segment tables Figure 3.16: Interaction of JT, SMT, PMT, and main memory in a segment/paging scheme To minimize number of references, many systems use associative memory to speed up the process Its disadvantage is the high cost of the complex hardware required to perform the parallel searches 51 52

27 Virtual Memory Summary Demand paging allows programs to be executed even though they are not stored entirely in memory Requires cooperation between the Memory Manager and the processor hardware Advantages of virtual memory management: Job size is not restricted to the size of main memory Memory is used more efficiently Allows an unlimited amount of multiprogramming 53 54

28 Virtual Memory (continued) Virtual Memory (continued) Advantages (continued): Eliminates external fragmentation and minimizes internal fragmentation Allows the sharing of code and data Facilitates dynamic linking of program segments Disadvantages: Increased processor hardware costs Increased overhead for handling paging interrupts Increased software complexity to prevent thrashing Table 3.6: Comparison of virtual memory with paging and segmentation 55 56

29 Summary (continued) Paged memory allocations allow efficient use of memory by allocating jobs in noncontiguous memory locations Increased overhead and internal fragmentation are problems in paged memory allocations Job no longer constrained by the size of physical memory in demand paging scheme LRU scheme results in slightly better efficiency as compared to FIFO scheme Segmented memory allocation scheme solves internal fragmentation problem Summary (continued) Segmented/demand paged memory allocation removes the problems of compaction, external fragmentation, and secondary storage handling Associative memory can be used to speed up the process Virtual memory allows programs to be executed even though they are not stored entirely in memory Job s size is no longer restricted to the size of main memory by using the concept of virtual memory CPU can execute instruction faster with the use of cache memory 57 58

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/1 CS 409, FALL 2013

MEMORY MANAGEMENT/1 CS 409, FALL 2013 MEMORY MANAGEMENT Requirements: Relocation (to different memory areas) Protection (run time, usually implemented together with relocation) Sharing (and also protection) Logical organization Physical organization

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

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

Basic Memory Management

Basic Memory Management Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester 10/15/14 CSC 2/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it

More information

Lecture 12: Demand Paging

Lecture 12: Demand Paging Lecture 1: Demand Paging CSE 10: Principles of Operating Systems Alex C. Snoeren HW 3 Due 11/9 Complete Address Translation We started this topic with the high-level problem of translating virtual addresses

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

CS450/550 Operating Systems

CS450/550 Operating Systems CS450/550 Operating Systems Lecture 4 memory Palden Lama Department of Computer Science CS450/550 Memory.1 Review: Summary of Chapter 3 Deadlocks and its modeling Deadlock detection Deadlock recovery Deadlock

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

Chapter 3: Important Concepts (3/29/2015)

Chapter 3: Important Concepts (3/29/2015) CISC 3595 Operating System Spring, 2015 Chapter 3: Important Concepts (3/29/2015) 1 Memory from programmer s perspective: you already know these: Code (functions) and data are loaded into memory when the

More information

Week 2: Tiina Niklander

Week 2: Tiina Niklander Virtual memory Operations and policies Chapters 3.4. 3.6 Week 2: 17.9.2009 Tiina Niklander 1 Policies and methods Fetch policy (Noutopolitiikka) When to load page to memory? Placement policy (Sijoituspolitiikka

More information

Memory management, part 2: outline

Memory management, part 2: outline Memory management, part 2: outline Page replacement algorithms Modeling PR algorithms o Working-set model and algorithms Virtual memory implementation issues 1 Page Replacement Algorithms Page fault forces

More information

Memory Management. Chapter 4 Memory Management. Multiprogramming with Fixed Partitions. Ideally programmers want memory that is.

Memory Management. Chapter 4 Memory Management. Multiprogramming with Fixed Partitions. Ideally programmers want memory that is. Chapter 4 Memory Management Ideally programmers want memory that is Memory Management large fast non volatile 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms

More information

Operating Systems Lecture 6: Memory Management II

Operating Systems Lecture 6: Memory Management II CSCI-GA.2250-001 Operating Systems Lecture 6: Memory Management II Hubertus Franke frankeh@cims.nyu.edu What is the problem? Not enough memory Have enough memory is not possible with current technology

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

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

Virtual Memory. Virtual Memory. Demand Paging. valid-invalid bit. Virtual Memory Larger than Physical Memory

Virtual Memory. Virtual Memory. Demand Paging. valid-invalid bit. Virtual Memory Larger than Physical Memory Virtual Memory Virtual Memory CSCI Operating Systems Design Department of Computer Science Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in

More information

Operating System Principles: Memory Management Swapping, Paging, and Virtual Memory CS 111. Operating Systems Peter Reiher

Operating System Principles: Memory Management Swapping, Paging, and Virtual Memory CS 111. Operating Systems Peter Reiher Operating System Principles: Memory Management Swapping, Paging, and Virtual Memory Operating Systems Peter Reiher Page 1 Outline Swapping Paging Virtual memory Page 2 Swapping What if we don t have enough

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

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

Virtual Memory Design and Implementation

Virtual Memory Design and Implementation Virtual Memory Design and Implementation To do q Page replacement algorithms q Design and implementation issues q Next: Last on virtualization VMMs Loading pages When should the OS load pages? On demand

More information

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1 Memory Allocation Copyright : University of Illinois CS 241 Staff 1 Recap: Virtual Addresses A virtual address is a memory address that a process uses to access its own memory Virtual address actual physical

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

Address spaces and memory management

Address spaces and memory management Address spaces and memory management Review of processes Process = one or more threads in an address space Thread = stream of executing instructions Address space = memory space used by threads Address

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

Paging and Page Replacement Algorithms

Paging and Page Replacement Algorithms Paging and Page Replacement Algorithms Section 3.4 Tanenbaum s book Kartik Gopalan OS Involvement with Page Table Management Four times when OS deals with page-tables 1. Process creation create page table

More information

Memory Management. Goals of Memory Management. Mechanism. Policies

Memory Management. Goals of Memory Management. Mechanism. Policies Memory Management Design, Spring 2011 Department of Computer Science Rutgers Sakai: 01:198:416 Sp11 (https://sakai.rutgers.edu) Memory Management Goals of Memory Management Convenient abstraction for programming

More information

Virtual Memory. Today.! Virtual memory! Page replacement algorithms! Modeling page replacement algorithms

Virtual Memory. Today.! Virtual memory! Page replacement algorithms! Modeling page replacement algorithms Virtual Memory Today! Virtual memory! Page replacement algorithms! Modeling page replacement algorithms Reminder: virtual memory with paging! Hide the complexity let the OS do the job! Virtual address

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

Operating Systems (1DT020 & 1TT802) Lecture 9 Memory Management : Demand paging & page replacement. Léon Mugwaneza

Operating Systems (1DT020 & 1TT802) Lecture 9 Memory Management : Demand paging & page replacement. Léon Mugwaneza Operating Systems (1DT020 & 1TT802) Lecture 9 Memory Management : Demand paging & page replacement May 05, 2008 Léon Mugwaneza http://www.it.uu.se/edu/course/homepage/os/vt08 Review: Multiprogramming (with

More information

For The following Exercises, mark the answers True and False

For The following Exercises, mark the answers True and False 1 For The following Exercises, mark the answers True and False 1. An operating system is an example of application software. False 2. 3. 4. 6. 7. 9. 10. 12. 13. 14. 15. 16. 17. 18. An operating system

More information

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register Memory Management 1. Describe the sequence of instruction-execution life cycle? A typical instruction-execution life cycle: Fetches (load) an instruction from specific memory address. Decode the instruction

More information

Operating Systems (2INC0) 2017/18

Operating Systems (2INC0) 2017/18 Operating Systems (2INC0) 2017/18 Memory Management (09) Dr. Courtesy of Dr. I. Radovanovic, Dr. R. Mak (figures from Bic & Shaw) System Architecture and Networking Group Agenda Reminder: OS & resources

More information

Chapter 8: Virtual Memory. Operating System Concepts

Chapter 8: Virtual Memory. Operating System Concepts Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Operating System Concepts

Operating System Concepts Chapter 9: Virtual-Memory Management 9.1 Silberschatz, Galvin and Gagne 2005 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped

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

Reminder: Mechanics of address translation. Paged virtual memory. Reminder: Page Table Entries (PTEs) Demand paging. Page faults

Reminder: Mechanics of address translation. Paged virtual memory. Reminder: Page Table Entries (PTEs) Demand paging. Page faults CSE 451: Operating Systems Autumn 2012 Module 12 Virtual Memory, Page Faults, Demand Paging, and Page Replacement Reminder: Mechanics of address translation virtual address virtual # offset table frame

More information

Processes and Tasks What comprises the state of a running program (a process or task)?

Processes and Tasks What comprises the state of a running program (a process or task)? Processes and Tasks What comprises the state of a running program (a process or task)? Microprocessor Address bus Control DRAM OS code and data special caches code/data cache EAXEBP EIP DS EBXESP EFlags

More information

Virtual Memory. Today. Segmentation Paging A good, if common example

Virtual Memory. Today. Segmentation Paging A good, if common example Virtual Memory Today Segmentation Paging A good, if common example Virtual memory system Goals Transparency Programs should not know that memory is virtualized; the OS +HW multiplex memory among processes

More information

Memory Management. To improve CPU utilization in a multiprogramming environment we need multiple programs in main memory at the same time.

Memory Management. To improve CPU utilization in a multiprogramming environment we need multiple programs in main memory at the same time. Memory Management To improve CPU utilization in a multiprogramming environment we need multiple programs in main memory at the same time. Basic CPUs and Physical Memory CPU cache Physical memory

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 15: Caching: Demand Paged Virtual Memory

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 15: Caching: Demand Paged Virtual Memory CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2003 Lecture 15: Caching: Demand Paged Virtual Memory 15.0 Main Points: Concept of paging to disk Replacement policies

More information

OPERATING SYSTEM. Chapter 9: Virtual Memory

OPERATING SYSTEM. Chapter 9: Virtual Memory OPERATING SYSTEM Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory

More information

Lecture #15: Translation, protection, sharing

Lecture #15: Translation, protection, sharing Lecture #15: Translation, protection, sharing Review -- 1 min Goals of virtual memory: protection relocation sharing illusion of infinite memory minimal overhead o space o time Last time: we ended with

More information

CS 333 Introduction to Operating Systems. Class 14 Page Replacement. Jonathan Walpole Computer Science Portland State University

CS 333 Introduction to Operating Systems. Class 14 Page Replacement. Jonathan Walpole Computer Science Portland State University CS 333 Introduction to Operating Systems Class 14 Page Replacement Jonathan Walpole Computer Science Portland State University Page replacement Assume a normal page table (e.g., BLITZ) User-program is

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 32 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Questions for you What is

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 33 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How does the virtual

More information

Question Points Score Total 100

Question Points Score Total 100 Midterm #2 CMSC 412 Operating Systems Fall 2005 November 22, 2004 Guidelines This exam has 7 pages (including this one); make sure you have them all. Put your name on each page before starting the exam.

More information

Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Chapter 9: Virtual Memory Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

More information

Recall from Tuesday. Our solution to fragmentation is to split up a process s address space into smaller chunks. Physical Memory OS.

Recall from Tuesday. Our solution to fragmentation is to split up a process s address space into smaller chunks. Physical Memory OS. Paging 11/10/16 Recall from Tuesday Our solution to fragmentation is to split up a process s address space into smaller chunks. Physical Memory OS Process 3 Process 3 OS: Place Process 3 Process 1 Process

More information

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems CSE 120 Principles of Operating Systems Fall 2016 Lecture 11: Page Replacement Geoffrey M. Voelker Administrivia Lab time This week: Thu 4pm, Sat 2pm Next week: Tue, Wed At Washington University in St.

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

Unit II: Memory Management

Unit II: Memory Management Unit II: Memory Management 1. What is no memory abstraction? The simplest memory abstraction is no abstraction at all. Early mainframe computers (before 1960), early minicomputers (before 1970), and early

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

Virtual Memory: Mechanisms. CS439: Principles of Computer Systems February 28, 2018

Virtual Memory: Mechanisms. CS439: Principles of Computer Systems February 28, 2018 Virtual Memory: Mechanisms CS439: Principles of Computer Systems February 28, 2018 Last Time Physical addresses in physical memory Virtual/logical addresses in process address space Relocation Algorithms

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 Design and Implementation

Virtual Memory Design and Implementation Virtual Memory Design and Implementation Today! Page replacement algorithms! Some design and implementation issues Next! Last on virtualization VMMs How can any of this work?!?!! Locality Temporal locality

More information

Chapter 9: Virtual Memory. Chapter 9: Virtual Memory. Objectives. Background. Virtual-address address Space

Chapter 9: Virtual Memory. Chapter 9: Virtual Memory. Objectives. Background. Virtual-address address Space Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

More information

Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

More information

Operating Systems Virtual Memory. Lecture 11 Michael O Boyle

Operating Systems Virtual Memory. Lecture 11 Michael O Boyle Operating Systems Virtual Memory Lecture 11 Michael O Boyle 1 Paged virtual memory Allows a larger logical address space than physical memory All pages of address space do not need to be in memory the

More information

Swapping. Operating Systems I. Swapping. Motivation. Paging Implementation. Demand Paging. Active processes use more physical memory than system has

Swapping. Operating Systems I. Swapping. Motivation. Paging Implementation. Demand Paging. Active processes use more physical memory than system has Swapping Active processes use more physical memory than system has Operating Systems I Address Binding can be fixed or relocatable at runtime Swap out P P Virtual Memory OS Backing Store (Swap Space) Main

More information

Wednesday, November 4, 2009

Wednesday, November 4, 2009 Wednesday, November 4, 2009 Topics for today Storage management Main memory (1) Uniprogramming (2) Fixed-partition multiprogramming (3) Variable-partition multiprogramming (4) Paging (5) Virtual memory

More information

Chapter 10: Virtual Memory. Background

Chapter 10: Virtual Memory. Background Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples 10.1 Background Virtual memory separation of user logical

More information

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1 Memory Allocation Copyright : University of Illinois CS 241 Staff 1 Allocation of Page Frames Scenario Several physical pages allocated to processes A, B, and C. Process B page faults. Which page should

More information

Memory Management Prof. James L. Frankel Harvard University

Memory Management Prof. James L. Frankel Harvard University Memory Management Prof. James L. Frankel Harvard University Version of 5:42 PM 25-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved. Memory Management Ideal memory Large Fast Non-volatile

More information

Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Chapter 10: Virtual Memory. Background. Demand Paging. Valid-Invalid Bit. Virtual Memory That is Larger Than Physical Memory

Chapter 10: Virtual Memory. Background. Demand Paging. Valid-Invalid Bit. Virtual Memory That is Larger Than Physical Memory Chapter 0: Virtual Memory Background Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples Virtual memory separation of user logical memory

More information

Requirements, Partitioning, paging, and segmentation

Requirements, Partitioning, paging, and segmentation Requirements, Partitioning, paging, and segmentation Main Memory: The Big Picture kernel memory proc struct kernel stack/u area Stack kernel stack/u area Stack kernel stack/u area Stack Data Text (shared)

More information

Virtual Memory 1. Virtual Memory

Virtual Memory 1. Virtual Memory Virtual Memory 1 Virtual Memory key concepts virtual memory, physical memory, address translation, MMU, TLB, relocation, paging, segmentation, executable file, swapping, page fault, locality, page replacement

More information

Virtual Memory: From Address Translation to Demand Paging

Virtual Memory: From Address Translation to Demand Paging Constructive Computer Architecture Virtual Memory: From Address Translation to Demand Paging Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology November 12, 2014

More information

Lecture#16: VM, thrashing, Replacement, Cache state

Lecture#16: VM, thrashing, Replacement, Cache state Lecture#16: VM, thrashing, Replacement, Cache state Review -- 1 min Multi-level translation tree: multi-level page table, paged paging, paged segmentation, hash table: inverted page table combination:

More information

Page Replacement. 3/9/07 CSE 30341: Operating Systems Principles

Page Replacement. 3/9/07 CSE 30341: Operating Systems Principles Page Replacement page 1 Page Replacement Algorithms Want lowest page-fault rate Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number

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. Objectives. Introduction. 6.2 Types of Memory

Memory. Objectives. Introduction. 6.2 Types of Memory Memory Objectives Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured. Master the concepts

More information

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner CPS104 Computer Organization and Programming Lecture 16: Virtual Memory Robert Wagner cps 104 VM.1 RW Fall 2000 Outline of Today s Lecture Virtual Memory. Paged virtual memory. Virtual to Physical translation:

More information

Lecture 17. Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne

Lecture 17. Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne Lecture 17 Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne Page Replacement Algorithms Last Lecture: FIFO Optimal Page Replacement LRU LRU Approximation Additional-Reference-Bits

More information

ECE468 Computer Organization and Architecture. Virtual Memory

ECE468 Computer Organization and Architecture. Virtual Memory ECE468 Computer Organization and Architecture Virtual Memory ECE468 vm.1 Review: The Principle of Locality Probability of reference 0 Address Space 2 The Principle of Locality: Program access a relatively

More information

ECE7995 Caching and Prefetching Techniques in Computer Systems. Lecture 8: Buffer Cache in Main Memory (I)

ECE7995 Caching and Prefetching Techniques in Computer Systems. Lecture 8: Buffer Cache in Main Memory (I) ECE7995 Caching and Prefetching Techniques in Computer Systems Lecture 8: Buffer Cache in Main Memory (I) 1 Review: The Memory Hierarchy Take advantage of the principle of locality to present the user

More information

Operating systems. Part 1. Module 11 Main memory introduction. Tami Sorgente 1

Operating systems. Part 1. Module 11 Main memory introduction. Tami Sorgente 1 Operating systems Module 11 Main memory introduction Part 1 Tami Sorgente 1 MODULE 11 MAIN MEMORY INTRODUCTION Background Swapping Contiguous Memory Allocation Noncontiguous Memory Allocation o Segmentation

More information

ECE4680 Computer Organization and Architecture. Virtual Memory

ECE4680 Computer Organization and Architecture. Virtual Memory ECE468 Computer Organization and Architecture Virtual Memory If I can see it and I can touch it, it s real. If I can t see it but I can touch it, it s invisible. If I can see it but I can t touch it, it

More information

1. Background. 2. Demand Paging

1. Background. 2. Demand Paging COSC4740-01 Operating Systems Design, Fall 2001, Byunggu Yu Chapter 10 Virtual Memory 1. Background PROBLEM: The entire process must be loaded into the memory to execute limits the size of a process (it

More information

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2015 Lecture 23

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2015 Lecture 23 CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 205 Lecture 23 LAST TIME: VIRTUAL MEMORY! Began to focus on how to virtualize memory! Instead of directly addressing physical memory, introduce a level of

More information

Lecture 14 Page Replacement Policies

Lecture 14 Page Replacement Policies CS 423 Operating Systems Design Lecture 14 Page Replacement Policies Klara Nahrstedt Fall 2011 Based on slides by YY Zhou and Andrew S. Tanenbaum Overview Administrative Issues Page Replacement Policies

More information

Memory Management. Jo, Heeseung

Memory Management. Jo, Heeseung Memory Management Jo, Heeseung Today's Topics Why is memory management difficult? Old memory management techniques: Fixed partitions Variable partitions Swapping Introduction to virtual memory 2 Memory

More information

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang CHAPTER 6 Memory 6.1 Memory 341 6.2 Types of Memory 341 6.3 The Memory Hierarchy 343 6.3.1 Locality of Reference 346 6.4 Cache Memory 347 6.4.1 Cache Mapping Schemes 349 6.4.2 Replacement Policies 365

More information

CS510 Operating System Foundations. Jonathan Walpole

CS510 Operating System Foundations. Jonathan Walpole CS510 Operating System Foundations Jonathan Walpole Page Replacement Page Replacement Assume a normal page table (e.g., BLITZ) User-program is executing A PageInvalidFault occurs! - The page needed is

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

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table Question # 1 of 10 ( Start time: 07:24:13 AM ) Total Marks: 1 LRU page replacement algorithm can be implemented by counter stack linked list all of the given options Question # 2 of 10 ( Start time: 07:25:28

More information

Memory Management Outline. Operating Systems. Motivation. Paging Implementation. Accessing Invalid Pages. Performance of Demand Paging

Memory Management Outline. Operating Systems. Motivation. Paging Implementation. Accessing Invalid Pages. Performance of Demand Paging Memory Management Outline Operating Systems Processes (done) Memory Management Basic (done) Paging (done) Virtual memory Virtual Memory (Chapter.) Motivation Logical address space larger than physical

More information

Chapter 9: Virtual Memory. Operating System Concepts 9th Edition

Chapter 9: Virtual Memory. Operating System Concepts 9th Edition Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

More information

V. Primary & Secondary Memory!

V. Primary & Secondary Memory! V. Primary & Secondary Memory! Computer Architecture and Operating Systems & Operating Systems: 725G84 Ahmed Rezine 1 Memory Technology Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM)

More information

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Operating System - Virtual Memory

Operating System - Virtual Memory Operating System - Virtual Memory Virtual memory is a technique that allows the execution of processes which are not completely available in memory. The main visible advantage of this scheme is that programs

More information

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Managing Storage: Above the Hardware

Managing Storage: Above the Hardware Managing Storage: Above the Hardware 1 Where we are Last time: hardware HDDs and SSDs Today: how the DBMS uses the hardware to provide fast access to data 2 How DBMS manages storage "Bottom" two layers

More information

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Virtual Memory: From Address Translation to Demand Paging

Virtual Memory: From Address Translation to Demand Paging Constructive Computer Architecture Virtual Memory: From Address Translation to Demand Paging Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology November 9, 2015

More information

MEMORY MANAGEMENT. Term Paper. Operating Systems CS-384

MEMORY MANAGEMENT. Term Paper. Operating Systems CS-384 MEMORY MANAGEMENT Term Paper Operating Systems CS-384 Submitted to: Dr. Taylor Submitted by: Deepak Agrawal Submitted on: February 2, 2003 1 Table of contents (Index) Introduction 3 Contiguous memory allocation.3

More information

Design Issues 1 / 36. Local versus Global Allocation. Choosing

Design Issues 1 / 36. Local versus Global Allocation. Choosing Design Issues 1 / 36 Local versus Global Allocation When process A has a page fault, where does the new page frame come from? More precisely, is one of A s pages reclaimed, or can a page frame be taken

More information

CS 134: Operating Systems

CS 134: Operating Systems CS 134: Operating Systems More Memory Management CS 134: Operating Systems More Memory Management 1 / 27 2 / 27 Overview Overview Overview Segmentation Recap Segmentation Recap Segmentation Recap Segmentation

More information

Memory Management. q Basic memory management q Swapping q Kernel memory allocation q Next Time: Virtual memory

Memory Management. q Basic memory management q Swapping q Kernel memory allocation q Next Time: Virtual memory Memory Management q Basic memory management q Swapping q Kernel memory allocation q Next Time: Virtual memory Memory management Ideal memory for a programmer large, fast, nonvolatile and cheap not an option

More information