Skip to content

Commit f056479

Browse files
committed
Double check the changes
1 parent a2ecd69 commit f056479

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

support/developer/webapps/iis/site-behavior-performance/data-capture-managed-memory-leak.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This article outlines the steps to capture memory dumps associated with managed
1414

1515
## Memory leak issue is easily replicable
1616

17-
If the memory leak issue can be consistently reproduced whenever needed, use one of the following methods to capture data:
17+
If the memory leak issue can be consistently reproduced whenever needed, use one of the following methods to capture data.
1818

1919
### Method 1: Using Procdump
2020

@@ -35,15 +35,19 @@ If the memory leak issue can be consistently reproduced whenever needed, use one
3535

3636
1. Download and install [Debug Diagnostic Tool v2 Update 3.2](https://www.microsoft.com/download/details.aspx?id=103453).
3737
1. When a memory leak occurs, open **DebugDiag 2 Collection** from the **Start** menu:
38+
3839
:::image type="content" source="media/data-capture-managed-memory-leak/debugdiag-2-collection.png" alt-text="Screenshot of DebugDiag 2 Collection.":::
40+
3941
> [!NOTE]
4042
> If you need to change the path where dumps are generated, select **Tools** > **Options And Settings** > **Manual Userdump Save Folder** to change it.
4143
1. Select the **Processes** tab.
4244
1. Locate the **w3wp** process with the **Process ID** column of the application in question.
4345
[!INCLUDE [How to get actual PID](../../../../includes/how-get-pid.md)]
4446
1. Right-click the **w3wp** process, select **Create Userdump Series**, and set the following options (adjust the numbers as needed). Don't select **Save & Close**.
47+
4548
:::image type="content" source="media/data-capture-managed-memory-leak/configure-userdump-series.png" alt-text="Screenshot of Configure UserDump Series.":::
46-
1. Once the memory consumption of **w3wp.exe** reaches the limit as described in the [Memory limit for different scenarios](high-memory-consumption-issues-overview.md#memory-limit-for-different-scenarios), select **Save & Close**.
49+
50+
1. Once the memory consumption of **w3wp.exe** reaches the limit as described in the [Memory limits for different scenarios](high-memory-consumption-issues-overview.md#memory-limits-for-different-scenarios), select **Save & Close**.
4751

4852
The dumps will start generating immediately.
4953

support/developer/webapps/iis/site-behavior-performance/high-memory-consumption-issues-overview.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.reviewer: khgupta, v-sidong
77
---
88
# Overview of high memory consumption issues
99

10-
This troubleshooting guide provides steps to diagnose and resolve high memory consumption issues in applications, focusing on scenarios involving memory leaks. It helps you understand typical symptoms, limits related to memory usage in different system configurations, and the tools required for effective diagnosis of the issue.
10+
This troubleshooting guide provides steps to diagnose and resolve high memory consumption issues in applications, focusing on scenarios involving memory leaks. It helps you understand typical symptoms, limits related to memory usage in different system configurations, and the tools required to diagnose the issue effectively.
1111

1212
## Data capture tools
1313

@@ -21,12 +21,12 @@ This troubleshooting guide provides steps to diagnose and resolve high memory co
2121
> - Multiple attempts might be needed to get a useful set of memory dumps.
2222
> - Ensure you have sufficient disk space for memory dumps. Each dump is approximately the size of the process at that time. For instance, if the process is 1 gigabyte (GB), generating three dumps requires about 4 GB of space.
2323
24-
## Memory limit for different scenarios
24+
## Memory limits for different scenarios
2525

2626
Memory leaks generally result in a steady increase in memory usage, leading to crashes or performance degradation:
2727

2828
> [!NOTE]
29-
> High memory usage doesn't always indicate a leak; processes might recover if the allocated memory is freed later. A memory leak is caused by a bug or bugs in the application, where allocations are never freed.
29+
> High memory usage doesn't always indicate a leak; processes might recover if the allocated memory is freed later. A memory leak is caused by one or more bugs in the application where allocations are never freed.
3030
3131
- **32-bit applications**: 32-bit applications might crash and throw an `OutOfMemory` exception when running out of memory, possibly without reporting errors before crashing. They can behave unpredictably if memory allocation failures aren't handled properly in the application code.
3232
- **64-bit applications**: 64-bit applications rarely fail when trying to allocate virtual memory due to the large address space. However, they can grow to have a very large virtual address space and cause excessive paging of physical memory, which affects the application and other applications that are competing for physical memory.
@@ -35,7 +35,7 @@ Memory leaks generally result in a steady increase in memory usage, leading to c
3535
| --- | --- | --- |
3636
| 32-bit applications on 32-bit Windows | 4 GB in total (2 GB in [user mode](/windows-hardware/drivers/gettingstarted/user-mode-and-kernel-mode), 2 GB in [kernel mode](/windows-hardware/drivers/gettingstarted/user-mode-and-kernel-mode))|If you use the **/LARGEADDRESSAWARE** flag in your 32-bit applications and the **/3GB** switch in the **boot.ini** file of the operating system during boot time, it makes the user mode memory 3 GB and the kernel mode 1 GB. |
3737
| 32-bit applications on 64-bit Windows | 4 GB in total (2 GB in [user mode](/windows-hardware/drivers/gettingstarted/user-mode-and-kernel-mode), 2 GB in [kernel mode](/windows-hardware/drivers/gettingstarted/user-mode-and-kernel-mode)) |If you use the **/LARGEADDRESSAWARE** flag in your 32-bit applications, it makes the user mode memory 4 GB. The kernel doesn't use the 32-bit address space on a 64-bit operating system. It uses only the required space from the 64-bit address space. |
38-
| 64-bit applications on 64-bit Windows | The theoretical memory limit 16 exabytes (EB). However, the actual memory limit is determined by the operating system and hardware capabilities. The practical limit on 64-bit Windows 10 is 256 terabytes (TB) (128 TB in user mode, 128 TB in kernel mode) |NA|
38+
| 64-bit applications on 64-bit Windows | The theoretical memory limit is 16 exabytes (EB). However, the actual memory limit is determined by the operating system and hardware capabilities. The practical limit on 64-bit Windows 10 is 256 terabytes (TB) (128 TB in user mode, 128 TB in kernel mode). |NA|
3939
|64-bit applications on 32-bit Windows |Invalid scenario |NA|
4040

4141
## Identify high memory usage
@@ -47,21 +47,21 @@ To monitor **Private Bytes (KB)**, follow these steps:
4747
1. Open **IIS Manager**.
4848
1. Select your server name (on the left).
4949
1. Double-click **Worker Processes**.
50-
1. Check **Private Bytes (KB)**. Here is a screenshot:
50+
1. Check **Private Bytes (KB)**. Here's a screenshot:
5151

52-
:::image type="content" source="media/data-capture-managed-memory-leak/worker-process.png" alt-text="Screenshot of Worker Processes.":::
52+
:::image type="content" source="media/data-capture-managed-memory-leak/worker-process.png" alt-text="Screenshot of Worker Processes in which the Private Bytes (KB) column is highlighted.":::
5353

54-
If the value of **Private Bytes (KB)** for the **w3wp.exe** process (IIS worker process) reaches the memory limit as described in the [Memory limit for different scenarios](#memory-limit-for-different-scenarios), the **w3wp.exe** process has the high memory issue. **Process Id** and **Application Pool Name** are shown next to it. You might need to refresh this view manually.
54+
If the **Private Bytes (KB)** value for the **w3wp.exe** process (IIS worker process) reaches the memory limit as described in the [Memory limits for different scenarios](#memory-limits-for-different-scenarios), the **w3wp.exe** process has a high memory issue. The **Process Id** and **Application Pool Name** are shown next to it. You might need to refresh this view manually.
5555

56-
## Identify whether the memory leak is managed or native leak
56+
## Identify whether the memory leak is managed or native
5757

58-
Once you've confirmed that the **w3wp.exe** process is experiencing high memory usage, the next step is to identify whether it's managed or native memory leak. Follow these steps to identify the type of memory leak:
58+
Once you've confirmed that the **w3wp.exe** process is experiencing high memory usage, the next step is to identify whether it's a managed or native memory leak. Follow these steps to identify the type of memory leak:
5959

6060
1. Open **Performance Monitor** and select the **+** icon to add counters.
6161

6262
:::image type="content" source="media/high-memory-consumption-issues-overview/performance-monitor.png" alt-text="Screenshot that highlights the plus icon in Performance Monitor." lightbox="media/high-memory-consumption-issues-overview/performance-monitor.png":::
6363

64-
1. Select **# Bytes in all Heaps** under the **.NET CLR Memory** counter, select the target process (here it's **w3wp**), and then select **Add**.
64+
1. Select **# Bytes in all Heaps** under the **.NET CLR Memory** counter, select the target process (here, it's **w3wp**), and then select **Add**.
6565
1. Select **Private Bytes** and **Virtual Bytes** under the **Process** counter, select the target process, and then select **Add** (you can ignore the working set).
6666

6767
:::image type="content" source="media/high-memory-consumption-issues-overview/add-counters-performance-monitor.png" alt-text="Screenshot of the Add Counters window.":::
@@ -82,18 +82,18 @@ Once you've confirmed that the **w3wp.exe** process is experiencing high memory
8282

8383
Once you've confirmed the type of memory leak, the next step is to use tools to collect memory dumps of the process during the high memory usage event. These dumps can help you analyze and diagnose the cause of the issue.
8484

85-
- To collect dumps for managed memory leak, see [Data capture for managed memory leaks](data-capture-managed-memory-leak.md).
86-
- To collect dumps for native memory leak, see [Troubleshoot native memory leak in an IIS 7.x application pool](troubleshoot-native-memory-leak-iis-7x-application-pool.md).
85+
- To collect dumps for managed memory leaks, see [Data capture for managed memory leaks](data-capture-managed-memory-leak.md).
86+
- To collect dumps for native memory leaks, see [Troubleshoot native memory leak in an IIS 7.x application pool](troubleshoot-native-memory-leak-iis-7x-application-pool.md).
8787

8888
## .NET Core applications
8989

90-
If the application in question is .NET Core and hosted on IIS in in-process mode, use the steps for data collection in [Data capture for managed memory leaks](data-capture-managed-memory-leak.md) and [Troubleshoot native memory leak in an IIS 7.x application pool](troubleshoot-native-memory-leak-iis-7x-application-pool.md). However, if the application is hosted on IIS in out-of-process mode, modify the actions to investigate the dotnet process (**dotnet.exe** unless otherwise specified) instead of **w3wp.exe**. The same thing applies to self-hosted .NET Core applications.
90+
If the application in question is .NET Core and hosted on IIS in in-process mode, use the data collection steps in [Data capture for managed memory leaks](data-capture-managed-memory-leak.md) and [Troubleshoot native memory leak in an IIS 7.x application pool](troubleshoot-native-memory-leak-iis-7x-application-pool.md). However, if the application is hosted on IIS in out-of-process mode, modify the actions to investigate the dotnet process (**dotnet.exe** unless otherwise specified) instead of **w3wp.exe**. The same thing applies to self-hosted .NET Core applications.
9191

9292
## Troubleshooting example
9393

9494
Assume you have an application hosted on an IIS server and you experience high memory usage (the memory spikes up to around 7 GB by doing a stress test) when accessing a specific URL, follow these steps to diagnose the issue:
9595

96-
1. Check Performance Monitor by following the steps in [Identify whether the memory leak is managed or native leak](#identify-whether-the-memory-leak-is-managed-or-native-leak). If you notice **Private Bytes** and **# Bytes in all Heaps** remain constant, it's a managed memory leak.
96+
1. Check Performance Monitor by following the steps in [Identify whether the memory leak is managed or native](#identify-whether-the-memory-leak-is-managed-or-native). If you notice **Private Bytes** and **# Bytes in all Heaps** remain constant, it's a managed memory leak.
9797
1. Collect dump files by following the steps described in [Using DebugDiag](data-capture-managed-memory-leak.md#method-2-using-debugdiag).
9898
1. Open the dump files in [WinDbg](/windows-hardware/drivers/debugger/) and run the following commands based on your scenario.
9999

@@ -333,7 +333,7 @@ Assume you have an application hosted on an IIS server and you experience high m
333333
16 00000027`987ffd30 00000000`00000000 ntdll!RtlUserThreadStart+0x28
334334
```
335335
336-
1. Check the following code snippet in the **Link.cs** file, and then you see that there is an explicit call to `Thread.Sleep`, which is causing high memory usage.
336+
1. Check the following code snippet in the **Link.cs** file, and you'll see that there's an explicit call to `Thread.Sleep`, which is causing high memory usage.
337337
338338
```C#
339339
// BuggyBits.Models.Link
@@ -352,7 +352,7 @@ Assume you have an application hosted on an IIS server and you experience high m
352352
}
353353
```
354354

355-
The above step-by-step approach can help you diagnose and address high memory usage issues.
355+
The preceding step-by-step approach can help you diagnose and address high memory usage issues.
356356

357357
## More information
358358

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
After the first memory dump is created, you see confirmation in **Command Prompt**. By default, the memory dump is saved in the same location as **procdump.exe**.
1+
After the first memory dump is created, you see a confirmation in **Command Prompt**. By default, the memory dump is saved in the same location as **procdump.exe**.
22

33
If you're using other Procdump options that rely on specific conditions to trigger a dump, keep an eye on the PID. If it changes, you need to stop the command and run it again with the new PID. Otherwise, no memory dumps will be generated.

0 commit comments

Comments
 (0)