Skip to content

Commit 3d1292d

Browse files
authored
Update troubleshoot-application-service-memory-leaks.md
1 parent 0faeb2f commit 3d1292d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

support/windows-server/performance/troubleshoot-application-service-memory-leaks.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Application or service memory leaks troubleshooting guidance
2+
title: Application or Service Memory Leaks Troubleshooting Guidance
33
description: Provides guidance on how to troubleshoot application or service memory leaks.
4-
ms.date: 07/22/2025
4+
ms.date: 07/24/2025
55
manager: dcscontentpm
66
audience: itpro
77
ms.topic: troubleshooting
@@ -12,15 +12,15 @@ ms.custom:
1212
---
1313
# Application or service memory leaks troubleshooting guidance
1414

15-
This article provides guidance to troubleshoot applications or services with memory leak behaviors and how to proceed.
15+
This article provides guidance on troubleshooting applications or services with memory leak behaviors and how to proceed.
1616

1717
_Applies to:_   All supported versions of Windows Server and Windows Client
1818

1919
You see Event ID 2004 repeatedly in the system log. As the event source mentions, there's a resource exhaustion in the system on the virtual memory space. The description lists the system's top memory consumers at that time.
2020

2121
Apart from this event, you also notice high memory consumption by checking live or historical data from monitoring tools, or by using the Windows Task Manager.
2222

23-
The following troubleshooting process is helpful for both scenarios where first-party and third-party processes might be leaking memory. For first-party processes, you can use the public symbol store available. However, if you can't see the actual function in a third-party process, you can engage the vendor for further checking. Even if the function doesn't show, the allocation stack should indicate a third-party module.
23+
The following troubleshooting process is helpful for both scenarios where first-party and third-party processes might be leaking memory. For first-party processes, you can use the public symbol store available. However, if you can't see the actual function in a third-party process, you can engage the vendor for further check. Even if the function doesn't show, the allocation stack should indicate a third-party module.
2424

2525
## Before you begin
2626

@@ -50,17 +50,17 @@ Here are some examples:
5050

5151
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/task-manager-virtual-memory-commit-size.png" alt-text="Screenshot of Task Manager showing the VirtMemTest32 process with high commit size.":::
5252

53-
You can use [VMMap](/sysinternals/downloads/vmmap) and [Windows Performance Toolkit](/windows-hardware/test/wpt) for the troubleshooting.
53+
You can use [VMMap](/sysinternals/downloads/vmmap) and [Windows Performance Toolkit](/windows-hardware/test/wpt) for troubleshooting.
5454

5555
VMMap is used to determine the type of memory leaks. The Windows Performance Toolkit includes the Windows Performance Recorder (WPR) tool and the Windows Performance Analyzer (WPA) tool, which are used to collect and analyze data.
5656

5757
## Gather data
5858

59-
During this stage, if the memory usage is growing over time and not releasing, which indicates a leak pattern. The increase doesn't need to be a straight line to fall into this pattern, the key point is that the memory usage keeps on increasing over time.
59+
During this stage, if the memory usage is growing over time and isn't released, it indicates a leak pattern. The increase doesn't need to be a straight line to fall into this pattern. The key point is that the memory usage keeps on increasing over time.
6060

6161
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/increase-leak-pattern.png" alt-text="Screenshot of the memory usage with an increase pattern.":::
6262

63-
At this point, with a leak pattern, you need to determine the leaking memory type. Open VMMap and select the process that has been identified as the leaking memory.
63+
At this point, with a leak pattern, you need to determine the leaking memory type. Open VMMap and select the process that is identified as the leaking memory.
6464

6565
### Determine the memory type
6666

@@ -115,7 +115,7 @@ PEB32 1 0`00001000 ( 4.000 kB) 0.
115115

116116
### Collect trace data for virtual allocation memory
117117

118-
With the way to identify the leaking memory, the next step is to collect reproducible data to determine the driver responsible for the leaking allocations.
118+
Since you have the way to identify the leaking memory, the next step is to collect reproducible data to determine the driver responsible for the leaking allocations.
119119

120120
Use the following command to collect data when the process shows the behavior. **WPR.exe** is included natively on operating systems after Windows 10 or Windows Server 2016.
121121

@@ -127,7 +127,7 @@ C:\>wpr -start VirtualAllocation
127127

128128
Allow the process to run for some time. You can monitor the growth of memory consumption with Task Manager (**Commit size**).
129129

130-
Since it only collects virtual allocation data, the trace file won't grow that large, so you can let it run for several minutes. Once you see enough leaked memory, stop the trace by using the following command:
130+
Since it only collects virtual allocation data, the trace file doesn't grow so large, so you can leave it running for several minutes. Once you see enough leaked memory, stop the trace by using the following command:
131131

132132
```console
133133
C:\>wpr -stop virtalloc.etl
@@ -148,7 +148,7 @@ C:\>wpr -heaptracingconfig VirtMemTest32.exe enable
148148
> [!NOTE]
149149
> If the process is running when you run the command, restart the process for the setting to be enabled.
150150
151-
Heap tracing was successfully enabled for process **VirtMemTest64.exe**.
151+
Heap tracing is successfully enabled for process **VirtMemTest64.exe**.
152152

153153
The result is:
154154

@@ -157,7 +157,7 @@ Value name: `Tracing Flags`
157157
Value type: `REG_DWORD`
158158
Value data: `0x00000001 (1)`
159159

160-
You can delete the registry key or set the value to `0` after the troubleshooting.
160+
You can delete the registry key or set the value to `0` after troubleshooting.
161161

162162
Use the following command to collect data when the process shows the behavior. **WPR.exe** is included natively on operating systems after Windows 10 or Windows Server 2016.
163163

@@ -169,7 +169,7 @@ C:\>wpr -start Heap
169169

170170
Allow the process to run for some time. You can monitor the growth of memory consumption with Task Manager (**Commit size**).
171171

172-
Since it only collects heap data, the trace file won't grow that large, so you can let it run for several minutes. Once you see enough leaked memory, stop the trace by using the following command:
172+
Since it only collects heap data, the trace file doesn't grow so large, so you can leave it running for several minutes. Once you see enough leaked memory, stop the trace by using the following command:
173173

174174
```console
175175
C:\>wpr -stop Heap.etl
@@ -183,13 +183,13 @@ Open WPA and set up the symbol path. In the menu, select **Trace** > **Configure
183183

184184
### Analyze trace data for virtual allocation memory
185185

186-
Replicate the following view by replacing the process with the one you've identified as relevant. Ensure that the **Commit Stack** column is on the left of the gold/yellow line. Drill down by expanding the stack, and you'll see the function that shows the allocation of virtual memory. The driver listed before (up) the function is the one calling to that operation.
186+
Replicate the following view by replacing the process with the one you've identified as relevant. Ensure that the **Commit Stack** column is on the left of the gold/yellow line. Drill down by expanding the stack, and you see the function that shows the allocation of virtual memory. The driver listed before (up) the function is the one calling to that operation.
187187

188188
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/trace-data-virtual-allocation.png" alt-text="Screenshot of the analysis trace data for virtual allocation memory." lightbox="./media/troubleshoot-application-service-memory-leaks/trace-data-virtual-allocation.png":::
189189

190190
### Analyze trace data for heap allocation memory
191191

192-
Replicate the following view by replacing the process with the one you've already identified as relevant. Ensure that the **Handle** and **Stack** columns are on the left of the gold/yellow line. Drill down by expanding the stack, and you'll see the function that shows the allocation of heap memory. The driver listed before (up) the function is the one calling to that operation.
192+
Replicate the following view by replacing the process with the one you've already identified as relevant. Ensure that the **Handle** and **Stack** columns are on the left of the gold/yellow line. Drill down by expanding the stack, and you see the function that shows the allocation of heap memory. The driver listed before (up) the function is the one calling to that operation.
193193

194194
> [!NOTE]
195195
> If you don't see the heap allocation graph, it's because the registry key isn't set correctly. Review the steps.

0 commit comments

Comments
 (0)