Save this PDF as:

Size: px
Start display at page:

## Transcription

3 9.8 Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0, 1. Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms? LRU replacement FIFO replacement Optimal replacement The following page table is for a system with 16-bit virtual and physical addresses and with 4,096-byte pages. The reference bit is set to 1 when the page has been referenced. Periodically, a thread zeroes out all values of the reference bit. A dash for a page frame indicates the page is not in memory. The pagereplacement algorithm is localized LRU, and all numbers are provided in decimal. a. Convert the following virtual addresses (in hexadecimal) to the equivalent physical addresses. You may provide answers in either hexadecimal or decimal. Also set the reference bit for the appropriate entry in the page table. 0xE12C 0x3A9D 0xA9D9 0x7001 0xACA1 b. Using the above addresses as a guide, provide an example of a logical address (in hexadecimal) that results in a page fault. c. From what set of page frames will the LRU page-replacement algorithm choose in resolving a page fault? a. 0xE12C 0x312C

4 0x3A9D 0xAA9D 0xA9D9 0x59D9 0x7001 0xF001 0xACA1 0x5CA1 b. The only choices are pages 4, 8, 12, and 13. Thus, example addresses include anything that begins with the hexadecimal sequence 0x4..., 0x8..., 0xC..., and 0xD... c. Any page table entries that have a reference bit of zero. This includes the following frames {9, 1, 14, 13, 8, 0, 4} 9.10 Assume that you are monitoring the rate at which the pointer in the clock algorithm (which indicates the candidate page for replacement) moves. What can you say about the system if you notice the following behavior: a. pointer is moving fast b. pointer is moving slow If the pointer is moving fast, then the program is accessing a large number of pages simultaneously. It is most likely that during the period between the point at which the bit corresponding to a page is cleared and it is checked again, the page is accessed again and therefore cannot be replaced. This results in more scanning of the pages before a victim page is found. If the pointer is moving slow, then the virtual memory system is finding candidate pages for replacement extremely efficiently, indicating that many of the resident pages are not being accessed Discuss situations in which the LFU page-replacement algorithm generates fewer page faults than the LRU page-replacement algorithm. Also discuss under what circumstances the opposite holds. Consider the following sequence of memory accesses in a system that can hold four pages in memory: When page 5 is accessed, the least frequently used page-replacement algorithm would replace a page other than 1, and therefore would not incur a page fault when page 1 is accessed again. On the other hand, for the sequence , the least recently used algorithm performs better Discuss situations in which the MFU page-replacement algorithm generates fewer page faults than the LRU page-replacement algorithm. Also discuss under what circumstances the opposite holds. Consider the sequence in a system that holds four pages in memory: The most frequently used page replacement algorithm evicts page 4while fetching page 5, while the LRU algorithm evicts page 1. This is unlikely to happen much in practice. For the sequence , the LRU algorithm makes the right decision The VAX/VMS system uses a FIFO replacement algorithm for resident pages and a free-frame pool of recently used pages. Assume that the free-frame pool is managed using the least recently used replacement policy. Answer the following questions: a. If a page fault occurs and if the page does not exist in the free-frame pool, how is free space generated for the newly requested page? b. If a page fault occurs and if the page exists in the free-frame pool, how is the resident page set and the free-frame pool managed to make space for the requested page? c. What does the system degenerate to if the number of resident pages is set to one? d. What does the system degenerate to if the number of pages in the free-frame pool is zero?

5 a. When a page fault occurs and if the page does not exist in the free-frame pool, then one of the pages in the free-frame pool is evicted to disk, creating space for one of the resident pages to be moved to the free-frame pool. The accessed page is then moved to the resident set. b. When a page fault occurs and if the page exists in the free-frame pool, then it is moved into the set of resident pages, while one of the resident pages is moved to the free-frame pool. c. When the number of resident pages is set to one, then the system degenerates into the page replacement algorithm used in the free-frame pool, which is typically managed in a LRU fashion. d. When the number of pages in the free-frame pool is zero, then the system degenerates into a FIFO page-replacement algorithm Consider a demand-paging system with the following time-measured utilizations: CPU utilization 20% Paging disk 97.7% Other I/O devices 5% For each of the following, say whether it will (or is likely to) improve CPU utilization. Explain your answers. a. Install a faster CPU. b. Install a bigger paging disk. c. Increase the degree of multiprogramming. d. Decrease the degree of multiprogramming. e. Install more main memory. f. Install a faster hard disk or multiple controllers with multiple hard disks. g. Add prepaging to the page fetch algorithms. h. Increase the page size. The system obviously is spending most of its time paging, indicating over-allocation of memory. If the level of multiprogramming is reduced resident processes would page fault less frequently and the CPU utilization would improve. Another way to improve performance would be to get more physical memory or a faster paging drum. a. Install a faster CPU No. b. Install a bigger paging disk No. c. Increase the degree of multiprogramming No. d. Decrease the degree of multiprogramming Yes. e. Install more main memory Likely to improve CPU utilization as more pages can remain resident and not require paging to or from the disks. f. Install a faster hard disk or multiple controllers with multiple hard disks Also an improvement, for as the disk bottleneck is removed by faster response and more throughput to the disks, the CPU will get more data more quickly. g. Add prepaging to the page fetch algorithms Again, the CPU will get more data faster, so it will be more in use. This is only the case if the paging action is amenable to prefetching (i.e., some of the access is sequential). h. Increase the page size Increasing the page size will result in fewer page faults if data is being accessed sequentially. If data access is more or less random, more paging action could ensue because fewer pages can be kept in memory and more data is transferred per page fault. So this change is as likely to decrease utilization as it is to increase it Suppose that a machine provides instructions that can access memory locations using the one-level indirect addressing scheme. What is the sequence of page faults incurred when all of the pages of a program are currently nonresident and the first instruction of the program is an indirect memory load operation?

6 What happens when the operating system is using a per-process frame allocation technique and only two pages are allocated to this process? The following page faults take place: page fault to access the instruction, a page fault to access the memory location that contains a pointer to the target memory location, and a page fault when the target memory location is accessed. The operating system will generate three page faults with the third page replacing the page containing the instruction. If the instruction needs to be fetched again to repeat the trapped instruction, then the sequence of page faults will continue indefinitely. If the instruction is cached in a register, then it will be able to execute completely after the third page fault Suppose that your replacement policy (in a paged system) is to examine each page regularly and to discard that page if it has not been used since the last examination. What would you gain and what would you lose by using this policy rather than LRU or second-chance replacement? Such an algorithm could be implemented with the use of a reference bit. After every examination, the bit is set to zero; set back to one if the page is referenced. The algorithm would then select an arbitrary page for replacement from the set of unused pages since the last examination. The advantage of this algorithm is its simplicity nothing other than a reference bit need be maintained. The disadvantage of this algorithm is that it ignores locality by using only a short time frame for determining whether to evict a page or not. For example, a page may be part of the working set of a process, but may be evicted because it was not referenced since the last examination (that is, not all pages in the working set may be referenced between examinations) A page-replacement algorithm should minimize the number of page faults. We can achieve this minimization by distributing heavily used pages evenly over all of memory, rather than having them compete for a small number of page frames. We can associate with each page frame a counter of the number of pages associated with that frame. Then, to replace a page, we can search for the page frame with the smallest counter. a. Define a page-replacement algorithm using this basic idea. Specifically address these problems: i. What the initial value of the counters is ii. When counters are increased iii. When counters are decreased iv. How the page to be replaced is selected b. How many page faults occur for your algorithm for the following reference string, for four page frames? 1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2. c. What is the minimum number of page faults for an optimal page replacement strategy for the reference string in part b with four page frames? a. Define a page-replacement algorithm addressing the problems of: i. Initial value of the counters 0. ii. Counters are increased whenever a new page is associated with that frame. iii. Counters are decreased whenever one of the pages associated with that frame is no longer required. iv. How the page to be replaced is selected find a frame with the smallest counter. Use FIFO for breaking ties. b. 14 page faults c. 11 page faults

7 9.18 Consider a demand-paging system with a paging disk that has an average access and transfer time of 20 milliseconds. Addresses are translated through a page table in main memory, with an access time of 1 microsecond per memory access. Thus, each memory reference through the page table takes two accesses. To improve this time, we have added an associative memory that reduces access time to one memory reference, if the page-table entry is in the associative memory. Assume that 80 percent of the accesses are in the associative memory and that, of those remaining, 10 percent (or 2 percent of the total) cause page faults. What is the effective memory access time? effective access time = (0.8) (1 μsec) + (0.1) (2 μsec) + (0.1) (5002 μsec) = μsec = 0.5 millisec 9.19 What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem? Thrashing is caused by underallocation of the minimum number of pages required by a process, forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming. It can be eliminated by reducing the level of multiprogramming Is it possible for a process to have two working sets, one representing data and another representing code? Explain. Yes, in fact many processors provide two TLBs for this very reason. As an example, the code being accessed by a process may retain the same working set for a long period of time. However, the data the code accesses may change, thus reflecting a change in the working set for data accesses Consider the parameter Δ used to define the working-set window in the working-set model. What is the effect of setting Δ to a small value on the page fault frequency and the number of active (non-suspended) processes currently executing in the system? What is the effect when Δ is set to a very high value? When Δ is set to a small value, then the set of resident pages for a process might be underestimated, allowing a process to be scheduled even though all of its required pages are not resident. This could result in a large number of page faults. When Δ is set to a large value, then a process s resident set is overestimated and this might prevent many processes from being scheduled even though their required pages are resident. However, once a process is scheduled, it is unlikely to generate page faults since its resident set has been overestimated Assume there is an initial 1024 KB segment where memory is allocated using the Buddy system. Using Figure 9.26 as a guide, draw the tree illustrating how the following memory requests are allocated: request 240 bytes request 120 bytes request 60 bytes request 130 bytes Next, modify the tree for the following releases of memory. Perform coalescing whenever possible: release 240 bytes release 60 bytes release 120 bytes

### Chapter 9: Virtual-Memory Management

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

### Chapter 9: Virtual Memory. Operating System Concepts 8 th Edition,

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

### Chapter 9: Virtual-Memory Management. Operating System Concepts with Java 8 th Edition

Chapter 9: Virtual-Memory Management Operating System Concepts with Java 8 th Edition 9.1 Silberschatz, Galvin and Gagne 2009 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement

### Operating System Concepts 7 th Edition, Feb 22, 2005

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

### Virtual Memory. Virtual Memory

Virtual Memory Gordon College Stephen Brinton Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Demand Segmentation Operating System Examples Background

### Module 10: Virtual Memory

Module 10: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing Other Considerations Demand Segmenation Applied

### 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

### Chapter 9: Virtual Memory. Operating System Concepts 8 th Edition,

Chapter 9: Virtual Memory, Silberschatz, Galvin and Gagne 2009 Chapter 9: Virtual Memory Background Demand Paging Page Replacement Thrashing 9.2 Silberschatz, Galvin and Gagne 2009 Objectives To describe

### Chapter 9 Virtual-Memory Management. Operating System Concepts Essentials 9 th Edition

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

### Chapter 9: Virtual-Memory Management

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

### Chapter 9: Virtual-Memory Management

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

### Virtual Memory (Ch.10)

Virtual Memory (Ch.10)! Background! Demand Paging! Page Faults! Page Replacement! Page Replacement Algorithms! Thrashing! Strategies for Thrashing Prevention Silberschatz / OS Concepts / 6e - Chapter 10

### ICS Principles of Operating Systems

ICS 143 - Principles of Operating Systems Lectures 15 and 16 - Virtual Memory Prof. Ardalan Amiri Sani Prof. Nalini Venkatasubramanian ardalan@uci.edu nalini@ics.uci.edu Virtual Memory Background Demand

### ! Background! Demand Paging! Process Creation! Page Replacement. ! Allocation of Frames! Thrashing! Demand Segmentation! Operating System Examples

Chapter 9: Virtual Memory Background Demand Paging Process Creation Page Replacement Chapter 9: Virtual Memory Allocation of Frames Thrashing Demand Segmentation Operating System Examples Background 9.2

### Al-Anbar University /College of Computer Lecture Eight / Virtual Memory

8. Virtual Memory 8.1 Background 8.2 Demand Paging 8.3 Process Creation 8.4 Page Replacement 8.5 Allocation of Frames 8.6 Thrashing 8.7 Demand Segmentation 8.8 Examples 8.1 Background Virtual memory is

### 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

### Up until now we assumed that an entire program/process needed to be in memory to execute

Lecture Overview Virtual memory Demand paging Page faults Page replacement Frame allocation Thrashing Operating Systems - June 7, 00 Virtual Memory Up until now we assumed that an entire program/process

### Chapter 10: Virtual Memory. Background

Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Demand Segmentation Operating System Examples 10.1 Silberschatz, Galvin and Gagne 2003

### Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Demand Segmentation Operating System Examples 9.2 Silberschatz,

### CSI3131 Operating Systems Tutorial 8 Winter 2015 Virtual Memory

CSI11 Operating Systems Tutorial 8 Winter 015 Virtual Memory 1. Provide a short definition for each of the following terms: Page fault: Resident Set Working Set:. Describe how thrashing can occur in using

### Chapter 10: Virtual Memory. Virtual memory. Background Demand Paging Page Replacement Allocation of Frames Thrashing Operating System Example

Chapter 0: Virtual Memory Background Demand Paging Page Replacement Allocation of Frames Thrashing Operating System Example 0. Virtual memory separation of logical memory from physical memory only part

### Lecture 4: Memory Management

Lecture 4: Memory Management Background Program must be brought into memory and placed within a process for it to be run Input queue collection of processes on the disk that are waiting to be brought into

### Lesson 6: Memory Management & Virtualization

Lesson 6: Memory Management & Virtualization Contents Dynamic allocation, Memory fragmentation Paging Address translation with paging Paging hardware Page table structures Segmentation Virtual memory background

### Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Demand Segmentation Operating System Examples 9.2 Background

### 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"

### Basic Page Replacement

Basic Page Replacement 1. Find the location of the desired page on disk. Find a free frame: - If there is a free frame, use it - If there is no free frame, use a page replacement algorithm to select a

### CS420: Operating Systems

Virtual Memory James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Background Code needs

### Virtual Memory. Reading: Silberschatz chapter 10 Reading: Stallings. chapter 8 EEL 358

Virtual Memory Reading: Silberschatz chapter 10 Reading: Stallings chapter 8 1 Outline Introduction Advantages Thrashing Principal of Locality VM based on Paging/Segmentation Combined Paging and Segmentation

### Performance Example memory access time = 100 nanoseconds swap fault overhead = 25 msec page fault rate = 1/1000 EAT = (1-p) * p * (25 msec)

Memory Management Outline Operating Systems Processes Memory Management Basic Paging Virtual memory Virtual Memory Motivation Demand Paging Logical address space larger than physical memory Virtual Memory

### Operating Systems Memory Management

Operating Systems Memory Management ECE 344 ECE 344 Operating Systems 1 Memory Management Contiguous Memory Allocation Paged Memory Management Virtual Memory ECE 344 Operating Systems 2 Binding of Instructions

### OPERATING SYSTEM - VIRTUAL MEMORY

OPERATING SYSTEM - VIRTUAL MEMORY http://www.tutorialspoint.com/operating_system/os_virtual_memory.htm Copyright tutorialspoint.com A computer can address more memory than the amount physically installed

### Last Class: Demand Paged Virtual Memory!

Last Class: Demand Paged Virtual Memory! Benefits of demand paging: Virtual address space can be larger than physical address space. Processes can run without being fully loaded into memory. Processes

### Operating Systems. Virtual Memory

Operating Systems Virtual Memory Virtual Memory Topics. Memory Hierarchy. Why Virtual Memory. Virtual Memory Issues. Virtual Memory Solutions. Locality of Reference. Virtual Memory with Segmentation. Page

### Silberschatz and Galvin Chapter 9

Silberschatz and Galvin Chapter 9 Virtual Memory CPSC Richard Furuta /6/99 Virtual memory Virtual memory permits the execution of processes that are not entirely in physical memory Programmer benefits

### III. Memory Management, Virtual Memory

TDIU25: Operating Systems III. Memory Management, Virtual Memory SGG9: chapters 8 and 9 o Memory management: o contiguous allocation, fragmentation, segmentation, paging o Virtual memory: o demand paging,

### Memory Management. memory hierarchy

Memory Management Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory cache some medium-speed, medium price main memory gigabytes of

### Page Replacement Strategies. Jay Kothari Maxim Shevertalov CS 370: Operating Systems (Summer 2008)

Page Replacement Strategies Jay Kothari (jayk@drexel.edu) Maxim Shevertalov (max@drexel.edu) CS 370: Operating Systems (Summer 2008) Page Replacement Policies Why do we care about Replacement Policy? Replacement

### Virtual Memory. 4.1 Demand Paging

Chapter 4 Virtual Memory All the memory management policies we have discussed so far, try to keep a number of processes in the memory simultaneously to allow multiprogramming. But they require an entire

### 15 Demand Paging, Thrashing, Working Sets

70 15 Demand Paging, Thrashing, Working Sets Readings for this topic: Siberschatz/Galvin, chapter 9 So far we have separated the programmer s view of memory from the system s view using a mapping mechanism.

### CHAPTER 8 : VIRTUAL MEMORY. Introduction

CHAPTER 8 : VIRTUAL MEMORY Introduction In simple paging and segmentation, we realised that we can : Load program pages or segments into frames that may not necessarily be contigous. Make memory address

### Paging: Design Issues

Paging: Design Issues 1! 2! Readings Silbershatz et al: 9.5-9.6 3! Outline Frame Allocation Case Studies 4! Thrashing A process causing page faults every few instructions is said to be thrashing If a process

### ICS Principles of Operating Systems

ICS 143 - Principles of Operating Systems Operating Systems - Review of content from midterm to final Prof. Ardalan Amiri Sani Prof. Nalini Venkatasubramanian ardalan@uci.edu nalini@ics.uci.edu Deadlocks

### CS 134: Operating Systems

CS 134: Operating Systems Memory Fun with Paging CS 134: Operating Systems Memory Fun with Paging 1 / 37 Overview Cost of Faults Overview Overview Cost of Faults Algorithms Easy Approaches Realistic Approaches

### Memory Management. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Memory Management Yücel Saygın These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum 1 Memory Management Ideally programmers want memory that is large fast non volatile

### LOGICAL AND PHYSICAL ORGANIZATION MEMORY MANAGEMENT TECHNIQUES (CONT D)

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

### CS 31: Intro to Systems Virtual Memory. Kevin Webb Swarthmore College April 7, 2015

CS 31: Intro to Systems Virtual Memory Kevin Webb Swarthmore College April 7, 2015 Reading Quiz Memory Abstraction goal: make every process think it has the same memory layout. MUCH simpler for compiler

### VIRTUAL MEMORY MANAGEMENT, PART 3. CS124 Operating Systems Winter , Lecture 22

VIRTUAL MEMORY MANAGEMENT, PART 3 CS124 Operating Systems Winter 2013-2014, Lecture 22 2 Page Allocation Policy Last time, covered a number of page replacement policies Handle case when a page must be

### Chapter 3 Memory Management: Virtual Memory

Understanding Operating Systems, Fifth Edition 3-1 Chapter 3 Memory Management: Virtual Memory At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion Topics

### Review question: Memory management

OpenStax-CNX module: m28000 1 Review question: Memory management Duong Anh Duc This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 3.0 Review question of Memory

### 7. Memory Management

Lecture Notes for CS347: Operating Systems Mythili Vutukuru, Department of Computer Science and Engineering, IIT Bombay 7. Memory Management 7.1 Basics of Memory Management What does main memory (RAM)

### Memory Management. Overview

Memory Management 1 Overview Basic memory management Address Spaces Virtual memory Page replacement algorithms Design issues for paging systems Implementation issues Segmentation 2 1 Memory Management

### If a process does not have enough pages, the page-fault rate is very high. This leads to:

Thrashing If a process does not have enough pages, the page-fault rate is very high. This leads to: low CPU utilization operating system thinks that it needs to increase the degree of multiprogramming

### Virtual Memory: Demand Paging and Page Replacement

Virtual Memory: Demand Paging and Page Replacement Problems that remain to be solved: Even with 8K page size, number of pages /process is very large. Can t afford to keep the entire page table for a process

### CS5460: Operating Systems Lecture 16: Page Replacement (Ch. 9)

CS5460: Operating Systems Lecture 16: Page Replacement (Ch. 9) Last Time: Demand Paging Key idea: RAM is used as a cache for disk Don t give a process a page of RAM until it is needed When running short

### Memory Management Thrashing, Segmentation and Paging

Memory Management Thrashing, Segmentation and Paging CS 416: Operating Systems Design, Spring 2011 Department of Computer Science Rutgers Sakai: 01:198:416 Sp11 (https://sakai.rutgers.edu) Summary of Page

### Topic 14: Virtual Memory, Demand Paging, and Working Sets

CS 414 : Operating Systems UNIVERSITY OF VIRGINIA Department of Computer Science Fall 2005 Topic 14: Virtual Memory, Demand Paging, and Working Sets Readings for this topic: Ch.9 Separation of the programmer

### W4118: virtual memory

W8: virtual memory Instructor: Junfeng Yang References: Modern Operating Systems ( rd edition), Operating Systems Concepts (8 th edition), previous W8, and OS at MIT, Stanford, and UWisc Background: memory

### CSC501 Operating Systems Principles. Memory Management

CSC501 Operating Systems Principles Memory Management 1 Previous Lecture q Memory Management Q Segmentation Q Paging q Today s Lecture Q Lab 3 Q Page replacement algorithms Lab 3 : Demand Paging q Goal:

### CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 17 by Kuo-pao Yang

CHAPTER 6 Memory 6.1 Memory 313 6.2 Types of Memory 313 6.3 The Memory Hierarchy 315 6.3.1 Locality of Reference 318 6.4 Cache Memory 319 6.4.1 Cache Mapping Schemes 321 6.4.2 Replacement Policies 333

### Page replacement algorithms OS

Page replacement algorithms 1 When a page fault occurs 2 OS has to choose a page to evict from memory If the page has been modified, the OS has to schedule a disk write of the page The page just read overwrites

### University of Waterloo Midterm Examination

University of Waterloo Midterm Examination Spring, 2006 Student Name: Student ID Number: Section: Course Abbreviation and Number Course Title CS350 Operating Systems Sections 01 (14:30), 02 (11:30) Instructor

### Operating Systems, 6 th ed. Test Bank Chapter 7

True / False Questions: Chapter 7 Memory Management 1. T / F In a multiprogramming system, main memory is divided into multiple sections: one for the operating system (resident monitor, kernel) and one

### Memory Management. Main memory Virtual memory

Memory Management Main memory Virtual memory Main memory Background (1) Processes need to share memory Instruction execution cycle leads to a stream of memory addresses Basic hardware CPU can only access

### Operating Systems (1DT020 & 1TT802) Lecture 10 Memory Management: Demand paging & page replacement. File system: Interface.

Operating Systems (1DT020 & 1TT802) Lecture 10 Memory Management: Demand paging & page replacement File system: Interface May 07, 2008 Léon Mugwaneza http://www.it.uu.se/edu/course/homepage/os/vt08 Goals

### PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18

PROCESS VIRTUAL MEMORY CS124 Operating Systems Winter 2013-2014, Lecture 18 2 Programs and Memory Programs perform many interactions with memory Accessing variables stored at specific memory locations

### Cache Mapping. COMP375 Computer Architecture and Organization

Cache Mapping COMP375 Computer Architecture and Organization The only problem in computer architecture that is really hard to overcome is not having enough address bits. Gordon Bell Exam on Wednesday The

### COSC243 Part 2: Operating Systems

COSC243 Part 2: Operating Systems Lecture 20: Main Memory Management Zhiyi Huang Dept. of Computer Science, University of Otago Zhiyi Huang (Otago) COSC243 Lecture 20 1 / 29 O/S/ course overview Introduction

### SUBJECT CODE /NAME : CS6401 OPERATING SYSTEMS YEAR/SEM: II/04 QUESTION BANK

SUBJECT CODE /NAME : CS6401 OPERATING SYSTEMS YEAR/SEM: II/04 QUESTION BANK Unit-I OPERATING SYSTEMS OVERVIEW 1. Differentiate between tightly coupled systems and loosely coupled systems. 2. Define OS

### Memory Management. Operating Systems. Monoprogramming without Swapping or Paging. Multiprogramming

Operating Systems User OS Kernel & Device Drivers Interface Programs Management Management is an important resource that needs to be managed by the OS manager is the component of the OS responsible for

### Memory Management. Prof. P.C.P. Bhatt. P.C.P Bhat OS/M4/V1/2004 1

Memory Management Prof. P.C.P. Bhatt P.C.P Bhat OS/M4/V1/2004 1 What is a Von-Neumann Architecture? Von Neumann computing requires a program to reside in main memory to run. Motivation The main motivation

### The Operating System Level

The Operating System Level Virtual Memory File systems Parallel processing Case studies Due 6/3: 2, 3, 18, 23 Like other levels we have studied, the OS level is built on top of the next lower layer. Like

### Topics. Caches and Virtual Memory. Cache Operations. Cache Operations. Write Policies on Cache Hit. Read and Write Policies.

Topics Caches and Virtual Memory CS 333 Fall 2006 Cache Operations Placement strategy Replacement strategy Read and write policy Virtual Memory Why? General overview Lots of terminology Cache Operations

### Chapter 9: Memory Management

Chapter 9: Memory Management Background Logical versus Physical Address Space Overlays versus Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts 9.1 Background

### Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) (Review) Memory Management

Outline V22.0202-001 Computer Systems Organization II (Honors) (Introductory Operating Systems) Lecture 14 Memory Management March 28, 2005 Announcements Lab 4 due next Monday (April 4 th ) demos on 4

### CSE 513 Introduction to Operating Systems. Class 7 - Virtual Memory (2)

CSE 513 Introduction to Operating Systems Class 7 - Virtual Memory (2) Jonathan Walpole Dept. of Comp. Sci. and Eng. Oregon Health and Science University Key memory management issues Utilization Programmability

### Memory Management CS 447. Prof. R.K. Joshi Dept of CSE IIT Bombay

Memory Management CS 447 Prof. R.K. Joshi Dept of CSE IIT Bombay Some Simple Memory schemes Some Simple Memory schemes Some Simple Memory schemes Overlays: User level memory management (e.g. TurboPascal)

### Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct)

Memory Management 55 Memory Management Multitasking without memory management is like having a party in a closet. Charles Petzold. Programming Windows 3.1 Programs expand to fill the memory that holds

### Lecture 13: Thrashing

Lecture 13: Thrashing Thrashing: exposing the lie of VM Thrashing: processes on system require more memory than it has. P1 P2 P3 Real mem Each time one page is brought in, another page, whose contents

### Objectives and Functions

Objectives and Functions William Stallings Computer Organization and Architecture 6 th Edition Week 10 Operating System Support Convenience Making the computer easier to use Efficiency Allowing better

### csci 3411: Operating Systems

csci 3411: Operating Systems Virtual Memory II Gabriel Parmer Slides adapted from Silberschatz and West Caching Registers Cache Memory/ RAM Virtual Memory Registers Cache Memory/ RAM Disk Page Replacement

### CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems Fall 2004 Lecture 11: Page Replacement Geoffrey M. Voelker Memory Management Last lecture on memory management: Goals of memory management To provide a convenient

### Chapter 2 Memory Management: Early Systems. Understanding Operating Systems, Fourth Edition

Chapter 2 Memory Management: Early Systems Understanding Operating Systems, Fourth Edition Memory Management: Early Systems Memory is second only to processes in importance (and in intensity) with which

### Chapter 6, The Operating System Machine Level

Chapter 6, The Operating System Machine Level 6.1 Virtual Memory 6.2 Virtual I/O Instructions 6.3 Virtual Instructions For Parallel Processing 6.4 Example Operating Systems 6.5 Summary Virtual Memory General

### Lecture 17: Virtual Memory II. Goals of virtual memory

Lecture 17: Virtual Memory II Last Lecture: Introduction to virtual memory Today Review and continue virtual memory discussion Lecture 17 1 Goals of virtual memory Make it appear as if each process has:

### Lectures 21 : Memory Management (ii) Thu 19 Nov 2009

CS211: Programming and Operating Systems Lectures 21 : Memory Management (ii) Thu 19 Nov 2009 CS211 Lectures 21 : Memory Management (ii) 1/23 This afternoon... 1 Recall... Memory management 2 Contiguous

### 今回の概要. ! Page replacement algorithms. ! Frame Allocation. ! Thrashing. ! Other topics. " LRU approximation algorithms

オペレーティングシステム論第 9 回 今回の概要! Page replacement algorithms " LRU approximation algorithms! Frame Allocation! Thrashing! Other topics 2 LRU approximation algorithms ()! LRU page replacement needs rather complex

### Operating Systems Concepts: Chapter 8: Memory Management

Operating Systems Concepts: Chapter 8: Memory Management Olav Beckmann Huxley 449 http://www.doc.ic.ac.uk/~ob3 Acknowledgements: There are lots. See end of Chapter 1. Home Page for the course: http://www.doc.ic.ac.uk/~ob3/teaching/operatingsystemsconcepts/

### Lecture 10: Memory Management

Lecture 10: Memory Management CSE 120: Principles of Operating Systems guest starring Amin Vahdat Project 2 Due 11/14 Memory Management Next few lectures are going to cover memory management Goals of memory

CHAPTER 8 Although many systems are demand paged (discussed in Chapter 12), there are still many that are not, and in many cases the simpler memory-management strategies may be better, especially for small

### Module 4: Memory Management

Module 4: Memory Management The von Neumann principle for the design and operation of computers requires that a program has to be primary memory resident to execute. Also, a user requires to revisit his

### OPERATING SYSTEM PART-A UNIT-1 INTRODUCTION TO OPERATING SYSTEMS, SYSTEM STRUCTURES

OPERATING SYSTEM PART-A UNIT-1 INTRODUCTION TO OPERATING SYSTEMS, SYSTEM STRUCTURES 1. Define an operating system. Discuss its role with user and system viewpoints 2. Give the features of symmetric and

### Demand Paging & Page

Demand Paging & Page Replacement CSE, Spring 9 Computer Systems http://www.cs.washington.edu/ /8/9 cse-7-virtualmemory -9 Perkins, DW Johnson and University of Washington Reading Readings and References»

### Virtual Memory Paging

COS 318: Operating Systems Virtual Memory Paging Kai Li Computer Science Department Princeton University (http://www.cs.princeton.edu/courses/cos318/) Today s Topics Paging mechanism Page replacement algorithms

### Virtual Memory & Memory Management

CS 571 Operating Systems Virtual Memory & Memory Management Angelos Stavrou, George Mason University Memory Management 2 Logical and Physical Address Spaces Contiguous Allocation Paging Segmentation Virtual

### Last Class: Introduction to Operating Systems. Today: OS and Computer Architecture

Last Class: Introduction to Operating Systems User apps OS Virtual machine interface hardware physical machine interface An operating system is the interface between the user and the architecture. History

### 4 Main Memory Management

4 Main Memory Management 4.1 Introduction A large part of the OS s responsibility is organising main memory for processes. GOAL pack as many processes into memory as possible so that the processor will