[工具記錄]內存、優化工具若干

1,自帶工具

SF:

AMP

UE3:

StatsViewer

GameplayProfiler MemoryProfiler AIProfiler

2,渲染分析

PIX

GPA

PerfHUD

APPProfiler

NSight

VS2012

3,內存使用分析 

Sysinternals Suite

http://technet.microsoft.com/zh-cn/sysinternals/0e18b180-9b7a-4c49-8120-c47c5a693683(en-us).aspx

4,附錄

使用RamMap和VMMap工具解決Windows內存問題

 RamMapwindows

  RamMap用於展現系統和進程內存狀態和利用率。它提供一個命名爲「使用計數」的概要欄,它列出全部各類各樣的系統內存分區,如分頁池和非分頁池、流程私密的、可共享的、硬盤空間、內核堆棧和映射文件。它還顯示被稱爲Metafile的緩存文件內存空間的數量。緩存

  全部這些分區又進一步分類成不一樣類型的物理內存消耗,如活躍的、備用的、修改的、轉變的、調零的、免費的或糟糕的。這些列中的每個均可經過點擊列擡頭分類。全部這些術語在Russinovich的《Windows內部書》一書中都有解釋。app

  RamMap還在「進程」欄中顯示進程內在利用率。在這裏你能夠看到全部列出的進程,還有它們相應的私有內存利用率。數據還包括全部佔用備用或修改頁面列表的進程內存,還有用於頁表項的內存量。 ide

  RamMap的另外一種運用是顯示實際的物理內存用量,一頁一頁地識別內存清單、運用、文件名、進程、虛擬地址和池標籤等屬性。每一欄均可以分類,而且有一個過濾功能能夠用來有選擇性地分析數據。工具

  最後,RamMap在展示緩存文件活動和數據上也作得不錯。你能夠運用「文件摘要」和「文件詳細信息」欄向下查看系統文件緩存來肯定文件路徑、它佔用的大小、相應內存是在活躍的、備用的仍是修改的頁面列表中。ui

  VMMapthis

  到目前爲止,咱們已經明白了RamMap如何展現系統和進程內存使用。若是你要解決的內存問題看起來和特定的進程或應用相關,你也許有必要經過使用VMMap來仔細看看。VMMap是一個過程導向的工具,它讓你能夠查看現有的進程或者追蹤新的進程並查看其內存使用,它提供的信息遠比RamMap詳細。spa

  VMMap啓動時,它提示你選擇你想要審查的如今進程或是開啓一個新的進程。若是你啓動了一個新進程,你將能追蹤內存利用率,如堆和虛擬分配。code

  一旦VMMap的主窗口顯示,你能夠看見屏幕分紅幾部分。頂部部分是進程內存消耗的一個圖形概要。它分紅提交空間、專用字節和工做集。在屏幕的中部部分,內存利用率根據運用分類,如專有數據、共享數據、圖片、映射文件和堆大小。最後,屏幕底部顯示每一個虛擬地址相應的頁面類型是什麼、所用的工做集大小和數量、頁面保護、全部區塊和分區的細節。顏色標記讓你能夠快速地看到特定類型的內存消耗多少空間。orm

  VMMap提供有關進程地址空間的兩個額外視圖,包括一個「字符串」視圖和一個「分割」視圖。字符串視圖讓你能夠搜索地址空間中存在的全部可讀字符串。分割視圖以顏色標記的方式顯示進程虛擬地址空間,所以你能夠看到多種分配、它們的大小以及它們的連續性如何。

 

5,Help

Memory Types

VMMap categorizes memory into one of several types:

Image

The memory represents an executable file such as a .exe or .dll and has been loaded into a process by the image loader. It does not include images mapped as data files, which would be included in the Mapped File memory type. Image mappings can include shareable memory like code. When data regions, like initialized data, is modified, additional private memory is created in the process. The Details column shows the file's path.

Private

Private memory is memory allocated by VirtualAlloc and not suballocated either by the Heap Manager or the .NET run time. It cannot be shared with other processes, is charged against the system commit limit, and typically contains application data.

Shareable

Shareable memory is memory that can be shared with other processes, is backed by the paging file (if present), is charged against the system commit limit and typically contains data shared between DLLs in different processes or inter-process communication messages. The Windows APIs refer to this type of memory as pagefile-backed sections.

Mapped File

The memory is shareable and represents a file on disk. The Details column shows the file's path. Mapped files typically contain application data.

Heap

Heaps represent private memory managed by the user-mode heap manager and, like the Private memory type, is charged against the system commit limit and contains application data. Application memory allocations using the C runtime malloc library, HeapAlloc and LocalAlloc, use Heap memory.

Managed Heap

Managed heap represents private memory that's allocated and used by the .NET garbage collector and, like the Private memory type, is charged against the system commit limit and contains application data.

Stack

Stacks are private memory used to store function parameters, local function variables and function invocation records for individual threads. Stacks are charged agains the commit limit and typically grow on demand.

System

System memory is private kernel-mode physical memory associated with the process. The vast majority of System memory consists of the process page tables.

Free

Free memory regions are spaces in the process address space that are not allocated.

Note: The VirtualProtect API can change the protections of any page to something different than that implied by the original allocation's memory type. That means that there can potentially be pages of memory private to the process in a shareable memory region, for instance, because the region was created as a pagefile-backed section, but then the application changed the protection on some pages to copy-on-write and modified them. The protection shown for a region isn't necessarily the protection it had since it's creation. 

The VMMap Window

When you run VMMap, it will present a process selection dialog. After you select a process it analyzes the process and presents the graphs:

  • Commit Summary Graph This graph shows the committed (memory that represents data or code) memory usage of the process by type. The graph's scale is the total committed virtual memory usage of the process.

  • Private Summary Graph This graph shows the committed private virtual memory. This memory is backed by the paging file and charged against the system commit limit. It corresponds to the PrivateBytes performance counter.

  • Working Set Summary Graph This graph shows the working set usage of the process by memory type. Working set represents the amount of commited virtual memory that's in physical memory and owned by the process. The graph's scale is the total committed virtual memory.

The color key for the regions in the graphs is presented in the Summary View. Below the graphs VMMap shows two windows:

  • Summary View This shows a summary of the virtual and physical usage of the process by type.

  • Details View This shows the memory regions of the process address space.

For each region, VMMap displays the memory type, memory protection, and virtual and physical memory usage. Selecting a type in the Summary View filters the Details View to just show regions of the selected type. Select Total to show all memory types in the Details View. In order to reduce noise in the output, VMMap does not show entries that have a value of 0.

 

Both windows include the following columns of information:

Size

Total size of the allocated type or region. For the Summary View and regions in the Details View that do not have reserved areas, this is equal to the maximum amount of physical memory required to store the region's data.

Committed

The amount of the allocation backed by system virtual memory (RAM and paging files) and charged against the system commit limit.

Private

The amount of the allocation that, if modified, is private to the process (copy-on-write pages that have not been modified are included). This represents the charge to the system commit limit (sum of RAM plus the paging files) of the region.

Total WS

The amount of physical memory assigned to the type or region.

Private WS

The amount of physical memory assigned to the type or region that cannot be shared with other processes.

Shareable WS

The amount of physical memory assigned to the type or region that can be shared with other processes.

Shared WS

The amount of Shareable WS that is currently shared with other processes.

Locked WS

The amount of the working set that is locked into physical memory. This corresponds to memory locked via the VirtualAlloc API as well as Address Windowing Extensions (AWE) memory views. Note that working set figures returned by some other diagnostic tools does not include AWE memory.

Largest
The largest block of the particular size.

Note: Because of limitations in the APIs provided by the operating system, on 64-bit Windows XP or 64-bit Windows Server 2003, Vmmap does not show the regions corresponding to 32-bit thread stacks when analyzing 32-bit processes. 

相關文章
相關標籤/搜索