pool overview the windows pool has four basic allocation areas: allocations that can be paged out of...

18
www.buildwindows.com Understanding pool usage using Windows Performance Analyzer Rahul Nair Program Manager Microsoft Corporation HW-927P

Upload: louisa-obrien

Post on 29-Jan-2016

259 views

Category:

Documents


0 download

TRANSCRIPT

HW-927P: Understanding pool usage using Windows Performance Analyzer

Understanding pool usage using Windows Performance AnalyzerRahul NairProgram ManagerMicrosoft CorporationHW-927Pwww.buildwindows.com9/14/2011 4:37 PM1 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.AgendaPool Overview and ConceptsDemo: Collecting and Analyzing Pool DataGuidelines and Best Practices Key takeawayswww.buildwindows.comPool OverviewPool OverviewMemory resource for kernel mode components that the OS and device drivers use to store their data structuresPrimary Audience - Driver DevelopersMotivationPool usage is a significant contributor to the overall memory usage on a machineLargest consumer of memory immediately after bootAny reduction in Pool usage will reduce the overall memory usage of the system across the OSwww.buildwindows.comPool OverviewThe Windows Pool has four basic allocation areas:Allocations that can be paged out of memory to the pagefile

Paged PoolAllocations that are guaranteed to reside in memoryNonPaged PoolNew for Windows 8: Non Paged Pool allocations which are non-executable

NX NonPaged PoolAllocations made per session. These allocations are pageable

Session Poolwww.buildwindows.comPool Data Collection and AnalysisPool VocabularyGeneral Pool Type Non Paged Pool, Paged Pool etc.Session or Non-Session

Basic DataLifetime How long an allocation remains outstandingSize Size of an allocationStack Stack corresponding to the allocationAddress Address corresponding to allocationPage Address Page within which the allocation was placed

MetadataPool Tag 4 character label associated with an allocationPool Tag Module Module responsible for allocationSmall Pool Allocations smaller than a page (=4kB)NX Bit Represents non executable allocations

Context:Transient allocations with a short lifetime, measured in millisecondsOutstanding allocations that remain alive at the point in time being investigated

www.buildwindows.comPool Data CollectionPool data is collected system wide and not restricted to a single process or driver

StepsOpen Windows performance recorder UISelect Target application to be Entire SystemSelect Pool Usage from the Memory ProfilesSelect scenario of InterestGeneral or On/Off scenarioClick on Start to start tracing and Save to save the trace when done

Windows Performance Recorder UIwww.buildwindows.comWPA Pool AnalysisWPA displays 4 graphs for Pool

Pool Cumulative Allocation SizeWhat is the total size of allocations to a particular point in time?Pool Cumulative Allocation CountWhat is the total number of allocations to a particular point in time?Pool Outstanding Allocation SizeWhat is size of all allocations alive at a given point in time?Pool Outstanding Allocation CountWhat is the total number of allocations alive at a given point in time?

Pool graphs in Windows Performance Analyzerwww.buildwindows.comSummary TablesRaw data is exposed via summary tablesVocabularyAllocation lifetime is expressed based on the visible region used to generate the tableAIFO - Allocated inside, freed outsideAIFI - Allocated inside, freed insideAOFO - Allocated outside, freed outsideAOFI - Allocated outside, freed inside

Enable Summary table viewSummary table views for Windows Performance Analyzerwww.buildwindows.comDemoGuidance/Best PracticesGuidance and Best practicesApproachUnderstand and optimize pool usage for the most important user scenariosTransient and steady state memory usage

GuidancePool usage Be judicious and economical in allocation size and countMinimize Non Paged usage Pool allocations, MDL allocations, Non Paged CodeAllocation patterns Ensure that scenario specific allocations are freed as soon as possibleAvoid excessive pre-allocation that you might never useAvoid intermingling long and short lived allocations which causes fragmentation and increases memory usageMove Non Paged allocations to the more secure Non-Executable Non Paged Pool

www.buildwindows.comKey TakeawaysPool usage is a significant contributor to the overall memory usage of a systemUnderstand the pool usage of your component and utilize the tools to identify areas for optimization

www.buildwindows.comFor more informationRELATED SESSIONSHW-59T Improving performance with the Windows Performance ToolkitHW-141T Reducing the memory footprint of drivers and appsHW-928P Understanding heap data Using Windows Performance AnalyzerHW-977P Understanding VirtualAlloc usage using Windows Performance AnalyzerHW-925P Customizing WPA Trace ViewsHW-926P Introduction to the new WPA user interface

www.buildwindows.comFeedback and questions http://forums.dev.windows.com

Session feedbackhttp://bldw.in/SessionFeedback

thank youwww.buildwindows.com

2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.9/14/2011 4:37 PM17 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.