Unit OS5: Memory Management

Slides:



Advertisements
Similar presentations
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS1: Overview of Operating Systems 1.1. Windows.
Advertisements

MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
How to use Sysinternals tools to troubleshoot SharePoint/Office
How to Detect a Memory Leak By Using System Performance Monitor in Windows 2000.
© 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
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Chapter 11 - Monitoring Server Performance1 Ch. 11 – Monitoring Server Performance MIS 431 – created Spring 2006.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 10: Collect and Analyze Performance Data.
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 14 Server and Network Monitoring.
Operating Systems Day 1. Booting a Computer 1.Switch on the UPS electricity supply - green light electricity failure - red light charging – orange light.
®® Microsoft Windows 7 Windows Tutorial 10 Improving Your Computer’s Performance.
 Demand Technology Software, Inc. Memory Leaks Demand Technology 1020 Eighth Avenue South, Suite 6, Naples, FL phone: (941) fax: (941)
Virtual Memory Tuning   You can improve a server’s performance by optimizing the way the paging file is used   You may want to size the paging file.
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Scheduling in Windows Zoltan Micskei
1 Chapter Overview Monitoring Server Performance Monitoring Shared Resources Microsoft Windows 2000 Auditing.
Chapter 17: Watching Your System BAI617. Chapter Topics Working With Event Viewer Performance Monitor Resource Monitor.
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.
 Demand Technology Software, Inc. 32-bit Virtual Memory Constraints in Windows: an Update Mark Friedman Demand Technology 1020 Eighth Avenue South,
MCTS Guide to Microsoft Windows Vista Chapter 11 Performance Tuning.
MCTS Guide to Microsoft Windows 7
Hands-On Virtual Computing
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.5. Lab Slides & Lab Manual.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 14 Managing and Troubleshooting Windows 2000.
11 SYSTEM PERFORMANCE IN WINDOWS XP Chapter 12. Chapter 12: System Performance in Windows XP2 SYSTEM PERFORMANCE IN WINDOWS XP  Optimize Microsoft Windows.
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 Vista Inside Out Chapter 22 - Monitoring System Activities with Event Viewer Last modified am.
®® Microsoft Windows 7 for Power Users Tutorial 9 Evaluating System Performance.
Pushing the Limits of Windows
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS5: Memory Management 5.5. 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.
Unit OS11: Performance Evaluation Lab Manual.
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.
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.4. Lab Manual.
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.
14.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 14: Monitoring Windows Server.
Guide to Parallel Operating Systems with Windows 7 and Linux Chapter 10 Operating System Management.
Windows Vista Configuration MCTS : Maintenance and Optimization.
Unit OS5: Memory Management
Monitoring Windows Server 2012
Chapter Objectives In this chapter, you will learn:
Microsoft Word Objectives: Word processing using Microsoft Word
Hands-On Microsoft Windows Server 2008
Crash Dump Analysis - Santosh Kumar Singh.
MCTS Guide to Microsoft Windows 7
Unit OSC: Interoperability
Unit OS9: Real-Time and Embedded Systems
Unit OS4: Scheduling and Dispatch
Unit OS11: Performance Evaluation
Unit OS2: Operating System Principles
Unit OS10: Fault Tolerance
MONITORING MICROSOFT WINDOWS SERVER 2003
Unit OSB: Comparing the Linux and Windows Kernels
Creating a Windows Server 2016 Datacenter Virtual machine
Chapter 2/Module 2: Computer and managing files
Chapter 10 - Tuning Up System Performance
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Evaluating System Performance
Windows Processes and Services
Microsoft Excel 101.
3.3. Advanced Windows Synchronization
Bethesda Cybersecurity Club
European Computer Driving Licence
Presentation transcript:

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

Copyright Notice © 2000-2005 David A. Solomon and Mark Russinovich Lab Manual - OS5 Memory Management Copyright Notice © 2000-2005 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)

Lab Manual - OS5 Memory Management DLL Usage Lab Manual - OS5 Memory Management To diagnose DLL conflicts, you need to know which DLLs were loaded and from where Pviewer & pview & tlist lists the loaded DLLs, but not the path (e.g. type “tlist explorer”) Dependency Walker can trace DLL loads Process Explorer or listdlls from www.sysinternals.com lists full path

Process Explorer: DLL lab 1 Lab Manual - OS5 Memory Management Process Explorer: DLL lab 1 Run Word and Excel In ProcExp, switch to DLL view Look at the DLL list for both Word and Excel and find a common Office DLL loaded in both processes Hint: sort by path Try and delete that DLL with Explorer Should get access denied error (not file locked) In ProcExp, use search to confirm who has this DLL loaded Should show up in both processes

Viewing the Working Set Lab Manual - OS5 Memory Management Viewing the Working Set Working set size counts shared pages in each working set Vadump (Resource Kit) can dump the breakdown of private, shareable, and shared pages C:\> Vadump –o –p 3968 Module Working Set Contributions in pages Total Private Shareable Shared Module 14 3 11 0 NOTEPAD.EXE 46 3 0 43 ntdll.dll 36 1 0 35 kernel32.dll 7 2 0 5 comdlg32.dll 17 2 0 15 SHLWAPI.dll 44 4 0 40 msvcrt.dll Lab objective: Viewing Process Working Set Sizes You can use the Performance tool to examine process working set sizes by looking at the following performance counters: Counter Description Process: Working Set Current size of the selected process’s working set in bytes Process: Working Set Peak Peak size of the selected process’s working set in bytes Process: Page Faults/Sec Number of page faults for the process that occur each second Several other process viewer utilities (such as Task Manager, Pview, and Pviewer) also display the process working set size. You can also get the total of all the process working sets by selecting the _Total process in the instance box in the Performance tool. This process isn’t real—it’s simply a total of the process-specific counters for all processes currently running on the system. The total you see is misleading, however, because the size of each process working set includes pages being shared by other processes. Thus, if two or more processes share a page, the page is counted in each process’s working set.

Lab Manual - OS5 Memory Management Process Memory Information Task Manager Processes tab 1 2 “Mem Usage” = physical memory used by process (working set size, not working set limit) Note: shared pages are counted in each process “VM Size” = private (not shared) committed virtual space in processes == process’s paging file allocation “Mem Usage” in status bar is not total of “Mem Usage” column (see later slide) 1 2 Configuring the Memory Manager Like most of Windows, the memory manager attempts to automatically provide optimal system performance for varying workloads on systems of varying sizes and types. While there are a limited number of registry values you can add and/or modify under the key HKLM\ SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management to override some of these default performance calculations, in general, the memory manager’s default computations will be sufficient for the majority of workloads. Many of the thresholds and limits that control memory manager policy decisions are computed at system boot time on the basis of memory size and product type. (Windows 2000 Professional and Windows XP Professional and Home editions are optimized for desktop interactive use, and Windows Server systems are optimized for running server applications.) 3 3 Screen snapshot from: Task Manager | Processes tab

Process Memory Information PerfMon - Process Object Lab Manual - OS5 Memory Management Process Memory Information PerfMon - Process Object “Virtual Bytes” = committed + reserved virtual space, including shared pages “Working Set” = working set size (not limit) (physical) “Private Bytes” = private virtual space (same as “VM Size” from Task Manager Processes list) Also: In Threads object, look for threads in Transition state - evidence of swapping (usually caused by severe memory pressure) 7 1 2 Lab objective: Accounting for Physical Memory Use By combining information available from performance counters with output from kernel debugger commands, you can come close to accounting for physical memory usage on a machine running Windows. To examine the memory usage information available through performance counters, run the Performance tool and add the counters to view the following information. Total process working set size To view this information, select the Process performance object and the Working Set counter for the _Total process instance. This number will be larger than the actual total process memory utilization because shared pages are counted in each process working set. To get a more accurate picture of process memory utilization, subtract free memory (available bytes), operating system memory used (nonpaged pool, resident paged pool, and resident operating system and driver code), and the size of the modified list from the total physical memory on the machine. What you’re left with is the memory being used by processes. Comparing this value against the total process working set size as reported by the Performance tool gives you some indication of the amount of sharing occurring between processes. Although examining process physical memory usage is interesting, of more concern is the private committed virtual memory usage by processes, because memory leaks show up as an increasing private virtual size, not an increasing working set size. Total system working set size To view this information, select the Memory processor object and the Cache Bytes counter. As explained in the section “System Working Set,” the total system working set size includes more than just the cache size— it includes the subset of paged pool, pageable operating system code, and pageable driver code that is resident and in the system working set. 2 7 1 Screen snapshot from: Performance Monitor counters from Process object

Memory Management Information Task Manager Performance tab Lab Manual - OS5 Memory Management Memory Management Information Task Manager Performance tab Total committed private virtual memory (total of “VM Size” in process tab + Kernel Memory Paged) not all of this space has actually been used in the paging files; it is “how much would be used if it was all paged out” “Commit charge limit” = sum of physical memory available for processes + current total size of paging file(s) does not reflect true maximum page file sizes (expansion) when “total” reaches “limit”, further VirtualAlloc attempts by any process will fail 3 3 4 Lab objective: Viewing System Page Files To view the list of page files, look in the registry at HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PagingFiles. This contains the paging file configuration settings modified through the System utility in Control Panel. In Windows 2000, click the Performance Options button on the Advanced tab, and then click the Change button. In Windows XP and Windows Server 2003, click the Advanced tab, click the Settings button in the Performance section, click the Advanced tab, and finally, click the Change button in the Virtual Memory section. 3 4 3 4 Screen snapshot from: Task Manager | Performance tab