May 15th, 2025
0 reactions

New memory profiling features in Timing Captures

Steven Pratschner
Program Manager

The 2505.09 release of PIX on Windows adds several new features to help you optimize your game’s use of memory.  These features include:

  • A set of metrics that track working set size, page fault count and page file usage.
  • A new lane in the Timeline that displays the working set size, and the amount of memory allocated by the various allocators throughout the capture.
  • A new UI layout focused on memory analysis. This layout enables you to analyze the memory allocations and accesses made during the capture. Various data filters are provided to help you find cases where memory is allocated, but then never accessed. Links to the timeline view are provided for all memory accesses.

Memory-related Metrics

The memory metrics for your game’s process are available in both the Metrics layout and the System Monitor.  These counters enable you to track your commit charge, or page file usage, along with the number of page faults and the overall working set size.

winpix memory memory working set counters image

Memory Usage Lane in the Timeline

A new lane named Memory Usage is now available in the Timeline.  The amount of memory allocated per allocator throughout the capture is graphed, along with the working set size for your game’s process.

winpix memory memory memory usage lane image

Memory Analysis Layout

The Memory layout is used to analyze memory allocations, reads and writes collected when the Memory Access Sampling checkbox is selected before starting a Timing Capture.

winpix memory memory memory access sampling setting image

 

 

The primary user interface elements of the Memory layout are shown in the following figure.

  • Memory Usage graph.  A graph showing the working set size, and the amount of memory allocated by each type of allocator over the duration of the capture.
  • Controls to start analysis. A set of user interface controls for starting memory analysis.
  • Memory map. A map of all memory allocations made during the selected time range.
  • Analysis filters. The user interface controls used to filter the memory map based on a set of predefined criteria.
  • Control used to start animation. A control to start the animation needed to view individual memory accesses.
  • Memory allocation details panel.  A panel that provides details about the memory allocation that is selected in the memory map.
  • Memory analysis pivot table.  A pivot table for analyzing the data based on a set of predefined criteria. The pivots shown in the following figure are Allocation Thread and Allocation PIX event stack.

winpix memory memory layout overview image

Running Memory Analysis

The memory map is not populated when a capture is initially opened. To populate the map, select a region of time in the Memory Usage graph, select a memory type from the Memory Type dropdown and click the Analyze button.

winpix memory memory layout analyze image

The memory map is organized by memory address. Each box in the map represents a memory allocation at a particular address. The size of each box is relative to the size of the allocation. The boxes in the memory map are colored based on the legend to the left of the map. The following figure shows a memory map colored by memory type: CPU and GPU.

Selecting an allocation populates the Memory allocation details panel in the analysis panel with detailed information about that allocation, including its address, size, page size, allocator and callstack.

winpix memory memory layout populated map image

The allocations shown in the memory map can be filtered in various ways using the Lifetime, Allocation SizeAccess Sample Count and Alloc Page Size dropdowns. For example, the Lifetime dropdown can be used to filter the allocations that were made during the selected time, but were not freed by the end of the analysis window. These allocations represent potential memory leaks. Using the Access Sample Count filter to display only those allocations that were never accessed can help find memory that was allocated, but never used.

Use the pivot table to analyze the total amount of memory allocated in the selected region of time. The amount of memory allocated can be pivoted by various criteria including the allocating thread, and callstack and PIX event trees. In the following figure, the total amount of memory allocated is pivoted first by thread and then by the callstacks that allocated the memory.

winpix memory memory layout pivot table image

An option is provided to condense stack frames when the pivot table is pivoted by either Allocation Call Stack or Allocation PIX Event Stack. If a node in a stack tree has only one child, when condensed, that child node is removed and replaced with a visual indicator. Condensing stack trees makes it faster to navigate portions of the tree that have only one child. The amount of horizontal space is also optimized when stack trees are condensed. To condense a stack, select the Condense Frames option from the settings icon in the view.

winpix memory memory layout pivot table condense frames image

Analyzing memory access samples

Detailed information about each memory access, including a link to the Timeline at the point in time when the access occurred, along with its callstack, can be obtained by running a memory animation of the selected region of time. Use the Memory Animation button to run the animation. When running the animation, PIX processes each memory access in time-order fashion, highlighting the accesses in the map. Memory reads are highlighted in one color, and memory writes are highlighted in another. The following figure shows the memory map as an animation is running.

winpix memory memory layout animation image

As memory accesses are analyzed, hyperlinks and callstacks for each allocation and access are populated in the panel to the right hand side of the map. Clicking on a hyperlink navigates to the CPU sample in the Timeline that resulted in the memory access.

winpix memory memory layout access sample links image

As always, keep the bug reports and feature requests coming by clicking the PIX Feedback icon in the upper right corner of the UI.

Steven.

Category
PIX

Author

Steven Pratschner
Program Manager

I'm the Program Manager for the PIX CPU tools in the Gaming Division at Microsoft. PIX helps you identify the performance issues that may be affecting the frame rate of your DX12 AAA title on Windows and on Xbox.

0 comments