A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/dotnet/core/diagnostics/dotnet-gcdump below:

dotnet-gcdump diagnostic tool - .NET CLI - .NET

This article applies to: ✔️ dotnet-gcdump version 10.0 and later versions

Install

There are two ways to download and install dotnet-gcdump:

Note

To use dotnet-gcdump on an x86 app, you need a corresponding x86 version of the tool.

Synopsis
dotnet-gcdump [-h|--help] [--version] <command>
Description

The dotnet-gcdump global tool collects GC (Garbage Collector) dumps of live .NET processes using EventPipe. GC dumps are created by triggering a GC in the target process, turning on special events, and regenerating the graph of object roots from the event stream. This process allows for GC dumps to be collected while the process is running and with minimal overhead. These dumps are useful for several scenarios:

View the GC dump captured from dotnet-gcdump

On Windows, .gcdump files can be viewed in PerfView for analysis or in Visual Studio. Currently, there is no way of opening a .gcdump on non-Windows platforms.

You can collect multiple .gcdumps and open them simultaneously in Visual Studio to get a comparison experience.

Options Commands dotnet-gcdump collect

Collects a GC dump from a currently running process.

Warning

To walk the GC heap, this command triggers a generation 2 (full) garbage collection, which can suspend the runtime for a long time, especially when the GC heap is large. Don't use this command in performance-sensitive environments when the GC heap is large.

Synopsis
dotnet-gcdump collect [-h|--help] [-p|--process-id <pid>] [-o|--output <gcdump-file-path>] [-v|--verbose] [-t|--timeout <timeout>] [-n|--name <name>] [--dsrouter <ios|ios-sim|android|android-emu>]
Options

Note

To collect a GC dump using dotnet-gcdump, it needs to be run as the same user as the user running target process or as root. Otherwise, the tool will fail to establish a connection with the target process.

dotnet-gcdump ps

Lists the dotnet processes that GC dumps can be collected for. dotnet-gcdump 6.0.320703 and later, also display the command-line arguments that each process was started with, if available.

Synopsis
dotnet-gcdump ps [-h|--help]
Example

Suppose you start a long-running app using the command dotnet run --configuration Release. In another window, you run the dotnet-gcdump ps command. The output you'll see is as follows. The command-line arguments, if any, are shown using dotnet-gcdump version 6.0.320703 and later.

> dotnet-gcdump ps
  
  21932 dotnet     C:\Program Files\dotnet\dotnet.exe     run --configuration Release
  36656 dotnet     C:\Program Files\dotnet\dotnet.exe
dotnet-gcdump report <gcdump_filename>

Generate a report from a previously generated GC dump or from a running process, and write to stdout.

Synopsis
dotnet-gcdump report [-h|--help] [-p|--process-id <pid>] [-t|--report-type <HeapStat>]
Options Troubleshoot

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4