Windows XP Memory Management Aaron Lanoy and Jason Farnsworth.

Slides:



Advertisements
Similar presentations
1 Memory hierarchy and paging Electronic Computers M.
Advertisements

OS Fall’02 Virtual Memory Operating Systems Fall 2002.
4/14/2017 Discussed Earlier segmentation - the process address space is divided into logical pieces called segments. The following are the example of types.
Virtual Memory Chapter 18 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S. Dandamudi.
Memory/Storage Architecture Lab Computer Architecture Virtual Memory.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Virtual Memory Adapted from lecture notes of Dr. Patterson and Dr. Kubiatowicz of UC Berkeley.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Virtual Memory Chapter 8.
CS 333 Introduction to Operating Systems Class 11 – Virtual Memory (1)
Memory Management (II)
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
CS 333 Introduction to Operating Systems Class 11 – Virtual Memory (1)
Paging and Virtual Memory. Memory management: Review  Fixed partitioning, dynamic partitioning  Problems Internal/external fragmentation A process can.
Memory Management 2010.
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
Virtual Memory Chapter 8.
Chapter 3.2 : Virtual Memory
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Operating System Machine.
Virtual Memory and Paging J. Nelson Amaral. Large Data Sets Size of address space: – 32-bit machines: 2 32 = 4 GB – 64-bit machines: 2 64 = a huge number.
Computer Organization and Architecture
Virtual Memory I Chapter 8.
Memory Management April 28, 2000 Instructor: Gary Kimura.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
CS 241 Section Week #12 (04/22/10).
Windows 2000 Memory Management Computing Department, Lancaster University, UK.
Memory Management in Windows and Linux &. Windows Memory Management Virtual memory manager (VMM) –Executive component responsible for managing memory.
By Matthew Smith, John Allred, Chris Fulton. Requirements Relocation Protection Sharing Logical Organization Physical Organization.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
CS 346 – Chapter 8 Main memory –Addressing –Swapping –Allocation and fragmentation –Paging –Segmentation Commitment –Please finish chapter 8.
Address Translation Mechanism of 80386
Chapter 8 Memory Management Dr. Yingwu Zhu. Outline Background Basic Concepts Memory Allocation.
Computer Architecture Lecture 28 Fasih ur Rehman.
Operating Systems Unit 8: – Virtual Memory management Operating Systems.
Lecture 19: Virtual Memory
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Memory Management Fundamentals Virtual Memory. Outline Introduction Motivation for virtual memory Paging – general concepts –Principle of locality, demand.
1 Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: –illusion of having more physical memory –program relocation.
Virtual Memory 1 1.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Windows XP & Vista Memory Management
Chapter 91 Logical Address in Paging  Page size always chosen as a power of 2.  Example: if 16 bit addresses are used and page size = 1K, we need 10.
Review °Apply Principle of Locality Recursively °Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Lab4: Virtual Memory CS 3410 : Computer System Organization & Programming Spring 2015.
CHAPTER 3-3: PAGE MAPPING MEMORY MANAGEMENT. VIRTUAL MEMORY Key Idea Disassociate addresses referenced in a running process from addresses available in.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Virtual Memory.
CS161 – Design and Architecture of Computer
Chapter 2: The Linux System Part 4
CS161 – Design and Architecture of Computer
Chapter 9: Virtual Memory
Address Translation Mechanism of 80386
CS510 Operating System Foundations
Virtual Memory Chapter 8.
Review.
Chapter 9: Virtual-Memory Management
CS399 New Beginnings Jonathan Walpole.
The Operating System Machine Level
Virtual Memory فصل هشتم.
CSE451 Virtual Memory Paging Autumn 2002
Computer Architecture
Lecture 8: Efficient Address Translation
CSE 542: Operating Systems
Virtual Memory 1 1.
Presentation transcript:

Windows XP Memory Management Aaron Lanoy and Jason Farnsworth

Outline Virtual Memory Manager Memory Allocation Page Replacement Paged vs. non-paged pools Virtual Memory Manager Memory Allocation Page Replacement Paged vs. non-paged pools

Virtual Memory Manager Seems to let each process “have” 4GB of contiguous memory Page frames (main memory) or page files (disk) Copy-on-write Lazy allocation Disk I/O as little as possible, but fetches large chunks when done Seems to let each process “have” 4GB of contiguous memory Page frames (main memory) or page files (disk) Copy-on-write Lazy allocation Disk I/O as little as possible, but fetches large chunks when done

Virtual Memory Manager Allocates a unique 4GB virtual address space to each process A process can only access the first 2GB 4KB fixed-size page frames Pseudo-Exception: Large Pages Large set of contiguous pages treated as a single page Data that is always accessed together Speeds up page access Must be 2MB or greater multiple, must allow read & write, constituent pages must be contiguous in virtual and physical memory Allocates a unique 4GB virtual address space to each process A process can only access the first 2GB 4KB fixed-size page frames Pseudo-Exception: Large Pages Large set of contiguous pages treated as a single page Data that is always accessed together Speeds up page access Must be 2MB or greater multiple, must allow read & write, constituent pages must be contiguous in virtual and physical memory

Virtual Memory Manager Processes have one page directory table Loaded into page directory register Page directory entries point to page tables Page table entries point to page frames VMM uses virtual addresses along with the memory map to translate into a physical address Processes have one page directory table Loaded into page directory register Page directory entries point to page tables Page table entries point to page frames VMM uses virtual addresses along with the memory map to translate into a physical address

Address Translation Address Translation Animation

Virtual Memory Manager Address translation: Translation is algorithm very quick Delay caused by the time required to read PDE’s and PTE’s out of main memory Can be sped up through use of Translational Look-aside Buffer (TLB) Address translation: Translation is algorithm very quick Delay caused by the time required to read PDE’s and PTE’s out of main memory Can be sped up through use of Translational Look-aside Buffer (TLB)

Virtual Memory Manager PTE’s are 32 bits long, 5 of which are used for protection / state indication Read, write, execute, copy-on-write, exception flag, valid, modified, transition, etc… Copy-on-write Utilizes prototype page tables – instead of pointing directly to the frame, points to a PPTE that points to the frame File mapping, common area of memory for inter-process communication Better utilization of memory but longer address translations PTE’s are 32 bits long, 5 of which are used for protection / state indication Read, write, execute, copy-on-write, exception flag, valid, modified, transition, etc… Copy-on-write Utilizes prototype page tables – instead of pointing directly to the frame, points to a PPTE that points to the frame File mapping, common area of memory for inter-process communication Better utilization of memory but longer address translations

Memory Allocation 3-step memory allocation: Reservation Commitment Access Windows XP denies all “must-succeed requests” Shifts burden onto components to deal with the denial 3-step memory allocation: Reservation Commitment Access Windows XP denies all “must-succeed requests” Shifts burden onto components to deal with the denial

Memory Allocation Problem: Low memory situation Solution: I/O Throttling Switches from fetching large numbers of pages at each disk I/O access to fetching a single page at a time Slows down the system, but prevents crashes Problem: Low memory situation Solution: I/O Throttling Switches from fetching large numbers of pages at each disk I/O access to fetching a single page at a time Slows down the system, but prevents crashes

Memory Allocation Page frame database Tracks the state of all frames with a singly linked list for each possible state 8 States: Page frame database Tracks the state of all frames with a singly linked list for each possible state 8 States: Valid Modified No-write TransitionFree StandbyZeroed ModifiedBad

Page Replacement Scenario Page replacement demonstration Page replacement demonstration Page replacement demonstration Page replacement demonstration

Page Replacement The working set of a process is all of its pages that are in main memory Balance set manager moves some of a process’s working set to page files when memory becomes scarce Localized least-recently used policy to determine which pages to move to disk Working set max (can be dynamic) Working set min (dynamic only if system memory is low) The working set of a process is all of its pages that are in main memory Balance set manager moves some of a process’s working set to page files when memory becomes scarce Localized least-recently used policy to determine which pages to move to disk Working set max (can be dynamic) Working set min (dynamic only if system memory is low)

Memory Allocation Virtual Address Descriptors, the virtual address space allocated to a process Windows XP attempts to anticipate needed pages Demand paging: loads the requested page and nearby pages (spatial locality) Pages in the same cluster are likely to be part of the same file Loads the pages from an entire cluster at a time Results in higher memory usage, lowered disk hits Virtual Address Descriptors, the virtual address space allocated to a process Windows XP attempts to anticipate needed pages Demand paging: loads the requested page and nearby pages (spatial locality) Pages in the same cluster are likely to be part of the same file Loads the pages from an entire cluster at a time Results in higher memory usage, lowered disk hits

Memory Allocation Windows XP and prefetching Tracks the last 8 applications loaded, for the 9 th application, loads all the pages from those applications On boot, prefetches pages while devices are initialized Logical Prefetcher – records memory accesses in a scenario file Requires extra time to write this file Results in a less disk I/O (faster load times) Used for ALL applications and Windows XP itself Windows XP and prefetching Tracks the last 8 applications loaded, for the 9 th application, loads all the pages from those applications On boot, prefetches pages while devices are initialized Logical Prefetcher – records memory accesses in a scenario file Requires extra time to write this file Results in a less disk I/O (faster load times) Used for ALL applications and Windows XP itself

Paged vs. Non-paged Non-paged pool Cannot be written to disk Data always remains in memory Examples: Code for interrupt handling, unencrypted passwords, portions of device drivers and the VMM Cons: Limited space, no access paged pool or disk Non-paged pool Cannot be written to disk Data always remains in memory Examples: Code for interrupt handling, unencrypted passwords, portions of device drivers and the VMM Cons: Limited space, no access paged pool or disk

The Near-Future DEP (Data Execution Prevention): Security bit with all 64-bit processors and more recent Pentiums 32 vs. 64 bit systems DEP (Data Execution Prevention): Security bit with all 64-bit processors and more recent Pentiums 32 vs. 64 bit systems

Summary Virtual Memory Manager Memory Allocation Page Replacement Paged vs. non-paged pools Virtual Memory Manager Memory Allocation Page Replacement Paged vs. non-paged pools