Memory dump fixes/enhancements#1517
Merged
Merged
Conversation
9523915 to
9a7e13a
Compare
71829d1 to
375e260
Compare
375e260 to
8a828cd
Compare
TimHess
reviewed
May 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
heapdumpsendpointThis PR replaces the outdated copy from https://github.com/dotnet/diagnostics/blob/v9.0.621003/src/Tools/dotnet-gcdump (types such as
MemoryGraph) with a NuGet reference to thedotnet-gcdumpglobal tool. Steeltoe uses logic similar to https://github.com/dotnet/diagnostics/blob/v9.0.621003/src/Tools/dotnet-gcdump/CommandLine/CollectCommandHandler.cs.For the other dump types, Steeltoe uses logic similar to https://github.com/dotnet/diagnostics/blob/v9.0.621003/src/Tools/dotnet-dump/Dumper.cs, with one exception: it doesn't use the native Windows API to collect a dump, because that doesn't support all dump types.
With the changes above, all dump types are supported on all platforms (Windows, Linux, macOS). We can't test all dump types on macOS in cibuild, because they trigger an OS-level popup that hangs everything.
The filename of the resulting zip file now includes the type of dump.
In options,
HeapDumpTypewas changed fromstringtoenum, and its members are documented. This change doesn't break existingappsettings.jsonfiles.It's unclear why Visual Studio is unable to open .gcdump files, despite being documented otherwise. But the gcdump files from all platforms can be opened in PerfView and dotnet-heapview. A bug in dotnet-gcdump currently prevents it from loading a dump from disk.
For non-gcdumps, the binaries differ per platform.
dotnet-dumpglobal tool.threaddumpendpointThis PR syncs up the code with its origin (we can't reference the NuGet tool because its types are inaccessible), fixes several bugs and cleans up the JSON response.
classNamevalue into addedmoduleName(assembly) andclassName(type name with namespace), based on Spring docslineColumnin output, next to existinglineNumberReadOnlySpan<char>instead of strings, fix offset bugsGeneral
CancellationToken.NonewithTestContext.Current.CancellationTokenin other testsversions.propsCloses #1399.
Quality checklist
If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.