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: docs/core/diagnostics/debug-highcpu.md
+51-99Lines changed: 51 additions & 99 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,85 +32,60 @@ The tutorial uses:
32
32
33
33
## CPU counters
34
34
35
-
Before attempting this tutorial, please install the latest version of dotnet-counters:
36
-
37
-
```dotnetcli
38
-
dotnet tool install --global dotnet-counters
39
-
```
40
-
41
-
If your app is running a version of .NET older than .NET 9, the output UI of dotnet-counters will look slightly different; see [dotnet-counters](dotnet-counters.md) for details.
42
-
43
35
Before attempting to collect diagnostics data, you need to observe a high CPU condition. Run the [sample application](/samples/dotnet/samples/diagnostic-scenarios) using the following command from the project root directory.
44
36
45
37
```dotnetcli
46
38
dotnet run
47
39
```
48
40
49
-
To check the current CPU usage, use the [dotnet-counters](dotnet-counters.md) tool command:
41
+
To find the process ID, use the following command:
42
+
43
+
```dotnetcli
44
+
dotnet-trace ps
45
+
```
46
+
47
+
Take note of the process ID from your command output. Our process ID was `22884`, but yours will be different. To check the current CPU usage, use the [dotnet-counters](dotnet-counters.md) tool command:
Focusing in on the ```Last Delta``` values of ```dotnet.process.cpu.time```, these tell us how many seconds within the refresh period (currently set to the default of 1 s) the CPU has been active. With the web app running, immediately after startup, the CPU isn't being consumed at all and these deltas are both `0`. Navigate to the `api/diagscenario/highcpu` route with `60000` as the route parameter:
81
+
With the web app running, immediately after startup, the CPU isn't being consumed at all and is reported at `0%`. Navigate to the `api/diagscenario/highcpu` route with `60000` as the route parameter:
Now, rerun the [dotnet-counters](dotnet-counters.md) command.
85
+
Now, rerun the [dotnet-counters](dotnet-counters.md) command. If interested in monitoring just the `cpu-usage` counter, add '--counters System.Runtime[cpu-usage]` to the previous command. We are unsure if the CPU is being consumed, so we will monitor the same list of counters as above to verify counter values are within expected range for our application.
Copy file name to clipboardExpand all lines: docs/core/diagnostics/debug-memory-leak.md
+23-49Lines changed: 23 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,6 @@ The tutorial uses:
34
34
35
35
The tutorial assumes the sample apps and tools are installed and ready to use.
36
36
37
-
If your app is running a version of .NET older than .NET 9, the output UI of dotnet-counters will look slightly different; see [dotnet-counters](dotnet-counters.md) for details.
38
-
39
37
## Examine managed memory usage
40
38
41
39
Before you start collecting diagnostic data to help root cause this scenario, make sure you're actually seeing a memory leak (growth in memory usage). You can use the [dotnet-counters](dotnet-counters.md) tool to confirm that.
@@ -75,68 +73,44 @@ The live output should be similar to:
0 commit comments