HeapDump actuator produces invalid gcdump file #1399
Labels
Component/Management
Issues related to Steeltoe Management (actuators)
ReleaseLine/4.x
Identified as a feature/fix for the 4.x release line
Status/needs-investigation
Tickets needs more investigation
Type/bug
Something isn't working
Describe the bug
A gcdump downloaded from
/actuator/heapdump
can't be opened in PerfView or Visual Studio.To capture a gcdump, use the following configuration:
Error in PerfView:
Error in Visual Studio:
The Steeltoe documentation doesn't list
gcdump
as a possible dump type. However, Steeltoe v4 ignores the configured dump type on macOS and always takes a gcdump.I was able to hack together the following code that produces a gcdump file that can be opened in PerfView, but not in Visual Studio. It requires an assembly reference to
PerfView.exe
, downloaded from https://github.com/microsoft/perfview/releases, and a NuGet reference toMicrosoft.Diagnostics.Tracing.TraceEvent
v3.1.16. It also requires elevated permissions to run, which I haven't looked into any further.The code in Steeltoe to capture heap dumps (including gcdumps) relies on a very old copy of sources from PerfView. The CLR internals may have changed since then. A different approach could be to rely on dotnet-gcdump, which interestingly states the following:
Alternatively, we could drop support for capturing a gcdump entirely. The 3x Steeltoe source at https://github.com/SteeltoeOSS/Steeltoe/blob/release/3.2/src/Management/src/EndpointBase/HeapDump/HeapDumper.cs#L39 shows that a gcdump was taken only on .NET Core 3.x, or when explicitly configured. The 3x documentation states the following:
So it might be that gcdump support is just a left-over legacy feature from a time when it wasn't possible to capture a full dump.
@TimHess Do you have additional context on what happened and what Steeltoe should support?
The text was updated successfully, but these errors were encountered: