All Products
Search
Document Center

:Memory analysis tools for Windows

Last Updated:Apr 25, 2024

Note

Disclaimer: This topic may contain information about third-party products. The information is only for reference. Alibaba Cloud does not make any guarantee, express or implied, with respect to the performance and reliability of third-party products, as well as potential impacts of operations on the products.

Overview

Microsoft provides a variety of tools to analyze memory usage and memory issues in Windows, such as the built-in Task Manager, Resource Manager, and Performance Monitor, and SysInternals tools such as RAMMap and PoolMon. This topic describes how to use the tools. For more information, see the corresponding Microsoft documentation.

Use memory analysis tools for Windows

Note

Take note of the following items:

  • Before you perform high-risk operations such as modifying the configurations or data of Alibaba Cloud instances, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.

  • Before you modify the configurations or data of an instance, such as an Elastic Compute Service (ECS) instance or an ApsaraDB RDS instance, we recommend that you create snapshots or enable backup for the instance. For example, you can enable log backup for an ApsaraDB RDS instance.

  • If you have granted permissions on sensitive information or submitted sensitive information in the Alibaba Cloud Management Console, we recommend that you modify the sensitive information at the earliest opportunity. Sensitive information includes usernames and passwords.

The following sections describe how to use the memory analysis tools for Windows.

Note

You can use this topic only as reference when you use Windows ECS instances. The copyright of the official Microsoft links referenced in this topic belongs to Microsoft. Take note of the operating systems that this topic applies to. Microsoft products are subject to iterations, and the Microsoft links that are referenced in this topic may not be updated at the earliest opportunity. Alibaba Cloud is not liable for the content of the referenced Microsoft links.

Task Manager

In Windows, you can use Task Manager to monitor memory usage and display information about processes that consume memory resources. To calculate the virtual memory usage, click the Performance tab to obtain the size of the committed virtual memory and the commit limit. Then, divide the size of the committed virtual memory by the commit limit. If the size of the committed virtual memory is close to the commit limit, the system may encounter performance issues.

Windows 2008 R2

  1. Open Task Manager and click the Performance tab to view memory usage.

  2. You can add various memory metrics for inspection. Open Task Manager, click the Details > Select columns to add memory metrics. Make sure that you add the Memory > Working Set metric to check the physical memory usage of processes and the Memory > Commit Size metric to check the size of non-reserved virtual memory space.

Windows 2012

Open Task Manager and click the Performance tab to view memory usage.

Resource Monitor

Task Manager allows you to open Resource Manager to check the memory usage of individual processes. Monitor the amount of memory used by each process in the Commit (KB) column to check whether a process consumes a large amount of memory resources.

The physical memory consists of the following parts:

  • Hardware-reserved memory: Memory that is reserved for hardware.

  • Memory in use: Memory that is used by processes, drivers, and operating systems.

  • Modified memory:Memory whose contents must be written to a disk before the memory can be used for other purposes.

  • Standby memory: Memory that contains unused cache data and code.

  • Available memory: Memory that does not contain valuable data and will be used first when processes, drivers, and operating systems require more memory.

  • Cache: Memory that caches a file after the file is open to ensure that the file can be quickly read and written the next time the file is accessed. Windows 2008 R2 and later restrict the use of cache. Specific physical memory is not consumed by cache to ensure that physical memory is still available to meet application requirements when the cache is excessively large.

Performance Monitor

Performance Monitor is an important Windows tool for monitoring system resource consumption and collecting the corresponding statistics.

  1. To monitor performance consumption, you can add counters to check system resource consumption in real time, as shown in the following figure.

  2. You can also choose Data Collector Sets > User-Defined, add various counters such as Logical Disk, Memory, System, Processor, and Process to collect the real-time status of various system resources, and specify a sampling interval at which you want to collect monitoring statistics. For example, if a memory leak issue does not recur for an extended long period of time, you can set the sampling interval to 5 seconds. If the machine is prone to CPU exceptions, you can set the sampling interval to 1 second.

RAMMap and Process Explorer

RAMMap

In specific cases, you cannot view processes that consume an abnormal amount of memory in Task Manager. However, usage of physical memory indicates that invisible processes consume an abnormal amount of memory. In most cases, this issue occurs when the underlying layer of the system consumes memory resources. You can use the RAMMap tool provided by Microsoft to view the memory usage of the system. For more information about the tool, see RAMMap. Open RAMMap to view the memory usage that is not displayed in Task Manager.

Process Explorer

Process Explorer allows you to view detailed information about the resource usage of a process. For example, after you open Process Explorer, you can view the usages of multiple types of memory resources by a process.

image

Poolmon

The core memory resources of the Windows kernel are called non-paged pools (non-paged buffer pools) and paged pools (paged buffer pool). When the preceding pool resources are exhausted, the operating system may experience memory performance issues. You can use the preceding tools to view only the resource consumption. To identify which tag causes the system to run out of resources, use Poolmon. For more information, see Poolmon Overview.

Check the perfmon log to identify which pool tag causes the system to run out resources. For example, if the IoDn tag causes the system to run out of resources, run the following command to locate the SafeDogFileGuard.sys application to which the tag is attached, and then resolve the issue by modifying the application:

findstr /m /1 IoDn *.sys

The following command output is returned.

image