You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/windows-server/performance/troubleshoot-application-service-memory-leaks.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Aplication or service memory leaks troubleshooting guidance
2
+
title: Application or service memory leaks troubleshooting guidance
3
3
description: Provides guidance on how to troubleshoot application or service memory leaks.
4
4
ms.date: 07/22/2025
5
5
manager: dcscontentpm
@@ -22,7 +22,7 @@ Apart from this event, you also notice high memory consumption by checking live
22
22
23
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.
24
24
25
-
A few SysInternals tools and Windows Performance Toolkit will be used.
25
+
A few SysInternals tools and Windows Performance Toolkit are used.
26
26
27
27
## Before you begin
28
28
@@ -42,23 +42,23 @@ Description:
42
42
Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory:wpa.exe (9844) consumed 13714722816 bytes, msedgewebview2.exe (112572) consumed 3037757440 bytes, and EngHost.exe (37280) consumed 2619834368 bytes.
43
43
```
44
44
45
-
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/task-manager-testlimit.png" alt-text="Screenshot of Task Manager showing the Testlimit process with high memory consumption.":::
45
+
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/task-manager-test-limit.png" alt-text="Screenshot of Task Manager showing the process with high memory consumption.":::
46
46
47
47
The memory shown in the default list of columns isn't the one that should be focused on, since it represents the memory privately used by the process but backed by physical memory (working set). You need to verify virtual memory that is used by the operating system for its operation regardless of the way the virtual memory is backed (RAM or pagefile). In this case, you need to verify **Commit size**.
48
48
49
-
Here're some examples:
49
+
Here are some examples:
50
50
51
-
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/task-manager-testlimit-commit-size.png" alt-text="Screenshot of Task Manager showing the Testlimit process with high commit size.":::
51
+
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/task-manager-test-limit-commit-size.png" alt-text="Screenshot of Task Manager showing the process with high commit size.":::
52
52
53
-
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/task-manager-virtmem-commit-size.png" alt-text="Screenshot of Task Manager showing the VirtMemTest32 process with high commit size.":::
53
+
:::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.":::
54
54
55
55
You can use [VMMap](/sysinternals/downloads/vmmap) and [Windows Performance Toolkit](/windows-hardware/test/wpt) for the troubleshooting.
56
56
57
57
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.
58
58
59
59
## Gather data
60
60
61
-
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, what matters is that the memory usage keeps on increasing over time.
61
+
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.
62
62
63
63
:::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.":::
64
64
@@ -68,7 +68,7 @@ At this point, with a leak pattern, you need to determine the leaking memory typ
68
68
69
69
When virtual allocation memory is leaked, it's represented in VMMap as **Private Data**:
70
70
71
-
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/vmmap-private-data.png" alt-text="Screenshot of the virtual allocation memory leaks represented as Private Data in VMMap.":::
71
+
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/virtual-memory-private-data.png" alt-text="Screenshot of the virtual allocation memory leaks represented as Private Data in VMMap.":::
72
72
73
73
If you have a memory dump of the process, you can run the following command to see the memory layout. Virtual allocation shows as `<unknown>`:
When heap allocation memory is leaked, it's represented with **Heap**:
94
94
95
-
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/virtmem-heap-allocation.png" alt-text="Screenshot of the VirMemTest32 process with the heap allocation memory leaks represented as Heap in VMMap.":::
95
+
:::image type="content" source="./media/troubleshoot-application-service-memory-leaks/virtual-memory-heap-allocation.png" alt-text="Screenshot of the VirMemTest32 process with the heap allocation memory leaks represented as Heap in VMMap.":::
96
96
97
97
If you have a memory dump of the process, you can run the following command to see the memory layout. Heap allocation shows as `Heap`:
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.
121
121
122
-
Use the following command to collect data when the process shows the behavior. Note that **WPR.exe** is included natively on operating systems after Windows 10 or Windows Server 2016.
122
+
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.
123
123
124
124
Run the following command from a command prompt as an administrator:
Allow the process to run for some time. You can monitor the growth of memory consumption with Task Manager (**Commit size**).
131
131
132
-
Since it only collects virtual allocation data, the trace file won't grow that big, so you can let it run for several minutes. Once you see enough leaked memory, stop the trace by using the following command:
132
+
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:
133
133
134
134
```console
135
135
C:\>wpr -stop virtalloc.etl
136
136
```
137
137
138
138
### Collect trace data for heap allocation memory
139
139
140
-
Like virtual allocation, you can also leverage WPR for heap tracing.
140
+
Like virtual allocation, you can also use WPR for heap tracing.
141
141
142
142
However, a registry modification is required to enable the heap tracing. You can manually modify the registry or run the following command to enable heap tracing for the target process (for example, **VirtMemTest32.exe**).
143
143
@@ -161,7 +161,7 @@ Value data: `0x00000001 (1)`
161
161
162
162
You can delete the registry key after the troubleshooting or set the value to `0`.
163
163
164
-
Use the following command to collect data when the process shows the behavior. Note that WPR.exe is included natively on operating systems after Windows 10 or Windows Server 2016.
164
+
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.
165
165
166
166
Run the following command from a command prompt as an administrator:
167
167
@@ -171,7 +171,7 @@ C:\>wpr -start Heap
171
171
172
172
Allow the process to run for some time. You can monitor the growth of memory consumption with Task Manager (**Commit size**).
173
173
174
-
Since it only collects heap data, the trace file won't grow that big, so you can let it run for several minutes. Once you see enough leaked memory, stop the trace by using the following command:
174
+
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:
0 commit comments