Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS5: Memory Management 5.5. Lab Manual.

Slides:



Advertisements
Similar presentations
Default 3 GB user space 2 GB Per-Process Space 2 GB System Space 3 GB Per-Process Space 1 GB System Space.
Advertisements

Slide 19-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 19.
计算机系 信息处理实验室 Lecture 10 Memory Management(2)
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS1: Overview of Operating Systems 1.1. Windows.
Copyright ©: Lawrence Angrave, Vikram Adve, Caccamo 1 Virtual Memory III.
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
Linux Vs. Windows NT Memory Management Hitesh Kumar
Memory Management (continued) May 8, 2000 Instructor: Gary Kimura.
Installing Hugs on Windows March 31, Installing Hugs Go to Click on the Hugs link under implementations.
 Demand Technology Software, Inc. 32-bit Virtual Memory Constraints in Windows 2000 and 2003 Mark Friedman Demand Technology 1020 Eighth Avenue South,
 Demand Technology Software, Inc. Memory Leaks Demand Technology 1020 Eighth Avenue South, Suite 6, Naples, FL phone: (941) fax: (941)
Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Scheduling in Windows Zoltan Micskei
Windows 2000 Memory Management Computing Department, Lancaster University, UK.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS4: Scheduling and Dispatch 4.6. Demos.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
 Demand Technology Software, Inc. 32-bit Virtual Memory Constraints in Windows: an Update Mark Friedman Demand Technology 1020 Eighth Avenue South,
7.3. Windows Security Descriptors
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.5. Lab Slides & Lab Manual.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS2: Operating System Principles 2.5. Lab Manual.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS8: File System 8.4. NTFS Recovery Support.
Ch 6. Performance Rating Windows 7 adjusts itself to match the ability of the hardware –Aero Theme v. Windows Basic –Gaming features –TV recording –Video.
Pushing the Limits of Windows
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS4: Scheduling and Dispatch 4.6. Lab Manual.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS5: Memory Management 5.4. Physical Memory Management.
Unit OS8: File System 8.6. Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows Operating.
Virtual Memory 1 Chapter 13. Virtual Memory Introduction Demand Paging Hardware Requirements 4.3 BSD Virtual Memory 4.3 BSD Memory Management Operations.
Unit OS11: Performance Evaluation Lab Manual.
3.1. Concurrency, Critical Sections, Semaphores
Unit OS A: Windows Networking A.4. Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows.
Unit OS6: Device Management 6.4. Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows.
© 2004, D. J. Foreman 1 Implementing Processes and Threads.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS8: File System 8.1. Background: File System.
Unit OS12: Scripting Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows Operating.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS7: Security 7.1. The Security Problem.
Processes and Virtual Memory
UNIX & Windows NT Name: Jing Bai ID: Date:8/28/00.
Operating Systems Lesson 5. Plan Memory Management ◦ Memory segments types ◦ Processes & Memory ◦ Virtual Memory ◦ Virtual Memory Management ◦ Swap File.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS7: Security 7.4. Lab Manual.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Implementation.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.3. Advanced Windows Synchronization.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS1: Overview of Operating Systems 1.1. Windows.
COS 318: Operating Systems Virtual Memory Design Issues.
WINDOWS KPI’S Bruce Adamczak Senior Premier Field Engineer
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS5: Memory Management 5.3. Virtual Address Translation.
Unit OS5: Memory Management
Mysteries of Windows Memory Management Revealed
Jonathan Walpole Computer Science Portland State University
CSE451 Memory Management Continued Autumn 2002
Unit OS7: Security 7.4. Quiz Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze.
Unit OSC: Interoperability
Unit OS9: Real-Time and Embedded Systems
Unit OS4: Scheduling and Dispatch
Unit OS11: Performance Evaluation
Unit OS A: Windows Networking
Unit OS8: File System 8.6. Quiz
Unit OS2: Operating System Principles
Unit OS10: Fault Tolerance
Unit OSB: Comparing the Linux and Windows Kernels
Introduction to Operating Systems
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Page Replacement.
Unit OS5: Memory Management
3.3. Advanced Windows Synchronization
CSE451 Virtual Memory Paging Autumn 2002
Windows Kernel Internals Advance Virtual Memory
Module IV Memory Organization.
Presentation transcript:

Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS5: Memory Management 5.5. Lab Manual

2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows Operating System Internals Curriculum Development Kit, developed by David A. Solomon and Mark E. Russinovich with Andreas Polze Microsoft has licensed these materials from David Solomon Expert Seminars, Inc. for distribution to academic organizations solely for use in academic environments (and not for commercial use)

3 Roadmap for Section 5.5. Dynamic Link Library (DLL) Usage Viewing the Working Set Inspecting the Page Frame Number Database Perfmon and memory-related counters Monitoring page file consumption

4 Viewing DLLs and Memory Mapped Files

5 Prefetch Lab Lab Run Filemon – set filter as Notepad.exe Make a temporary directory somewhere (e.g. \temp) Run “Notepad \temp\x.y” Exit Notepad Run Notepad again In Filemon log, find creation of.PF file after first run, then use of new.PF in 2 nd run

6 Memory Management Information Task Manager Performance tab “Available” = sum of free, standby, and zero page lists (physical) Majority are likely standby pages Windows 2000/XP/Server 2003: count of shareable pages on standby, modified, and modified nowrite list are included in what was “File Cache” in NT4 New name is “System Cache” Screen snapshot from: Task Manager | Performance tab 6 6

7 PFN Database PFN = Page Frame Number = Physical Page Number PFN Database keeps track of the state of each physical page An array of structures, one element per physical page Maintains reference and share counts for pages in working sets Structure elements implement forward and backward links for free, modified, standby, zero, and bad page lists Does not reflect memory not managed by NT (e.g. adapter ram) kd> !pte ff !pte ff FF PDE at C0300FF4 PTE at C03FDC24 contains contains 0049E063 pfn DA--KWV pfn 0049E DA--KWV kd> !pfn 410 !pfn 410 PFN address FFBCC180 flink blink / share count B0 pteaddress C0300FF4 reference count 0001 color 0 restore pte containing page Active Screen snapshot from: kernel debugger !pte command use resulting displayed PFN on !pfn command

8 PFN Database Only way to get actual size of physical memory lists is to use !memusage in Kernel Debugger lkd> !memusage loading PFN database loading PFN database Zeroed: 0 ( 0 kb) Zeroed: 0 ( 0 kb) Free: 0 ( 0 kb) Free: 0 ( 0 kb) Standby: ( kb) Standby: ( kb) Modified: 161 ( 644 kb) Modified: 161 ( 644 kb) ModifiedNoWrite: 0 ( 0 kb) ModifiedNoWrite: 0 ( 0 kb) Active/Valid: ( kb) Active/Valid: ( kb) Transition: 8 ( 32 kb) Transition: 8 ( 32 kb) Unknown: 0 ( 0 kb) Unknown: 0 ( 0 kb) TOTAL: ( kb) TOTAL: ( kb) Screen snapshot from:kernel debugger !memusage command

9 Lab: Memory Leaks Run Leakyapp.exe (Resource Kit) In Task Manager Process tab, watch Mem Usage & VM Size grow (also look at Performance tab Commit limit/peak) Mem Usage will eventually reach an upper limit VM Size will grow until no more page file space

10 Page Fault Monitor (pfmon) Screen snapshot from: C:> pfmon notepad.exe