Skip to content

Add initial spec for gcheap dump tool - #512

Merged
josalem merged 5 commits into
dotnet:masterfrom
josalem:dev/josalem/gcheapdump-spec
Nov 1, 2019
Merged

josalem merged 5 commits into
dotnet:masterfrom
josalem:dev/josalem/gcheapdump-spec

Conversation

@josalem

@josalem josalem commented Sep 30, 2019

Copy link
Copy Markdown
Contributor

This is an initial specification for a commandline tool capable of collecting GC Heap Dumps of dotnet processes on Linux, Mac, and Windows.

CC - @caslan

@josalem josalem added documentation Documentation related issue diagnostic global tooling labels Sep 30, 2019
@josalem
josalem requested a review from noahfalk September 30, 2019 17:44
@josalem josalem self-assigned this Sep 30, 2019

@caslan caslan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

-o, --output
The path where collected dumps should be written. Defaults to '.\YYYYMMDD_HHMMSS.gcheapdump' where YYYYMMDD is Year/Month/Day
and HHMMSS is Hour/Minute/Second. Otherwise, it is the full path and file name of the dump.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GC dumps can be super large. Should we try to provide some kind of warning that the resulting file could be huge and that it may cause some heavy I/Os for a long time? Also it'd be nice if we can specify the upper bound for the heap dump. AFAIK PerfView lets you do that on a heap dump.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this actually dumps the contents of the heap, but rather all the metadata. Things like what types exist, where are they rooted, and how many of them are there. These dumps are computed based off a quick burst of GC events. It's possible we need a better name than gcdump... Would something like gcsnapshot be more indicative of what this is? @noahfalk, thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GC dumps can be super large.

It is possible, but my understanding is that by default they aren't because the algorithm that PerfView uses (and we are re-using) samples and filters the objects on the heap if the total size exceeds some threshold.

Should we try to provide some kind of warning that the resulting file could be huge and that it may cause some heavy I/Os for a long time?

The sampling probably mitigates this concern substantially, but assuming that wasn't the case my standard moves are:
a) Is there a similar experience we can copy as a reference?
b) Will it be that hard to change later if we pick wrong or have particularly bad consequences? If not just take guess at whatever seems best with the info at hand.
c) If there is still no clear winner, pick whatever is cheapest. Often this is 'do nothing'.

In this case those evaluate to:
a) dotnet-dump for heaps dumps is similar and we did not warn. +1 for leaving it as-is.
b) It won't be hard to change if we are wrong and running an unexpectedly long/slow/IO intensive command seems unlikely to be a big issue, the customer can kill the process. There are some pros and cons of each option, lets say its a wash here.
c) Doing nothing is cheaper. +1 for leaving it as-is.

It's possible we need a better name than gcdump... Would something like gcsnapshot be more indicative of what this is?

Possibly? Neither one seems clearer than the other to me, but I might be biased by insider knowledge : ) There is also 10ish years of historical precedent for calling it a gcdump on .Net Framework and that is what makes me think we shouldn't change it unless we have a fairly strong reason to do so. My guess is that less curious users of the tool won't know or care exactly what is in the gcdump, they will just be following a workflow shown to them by a web page or their coworker and they will be happy if they can resolve their memory issue. For more curious developers that want to understand the differences in these formats, blogs or docs could fill that role.

@josalem

josalem commented Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

Shouldn't it follow the same default output file generated by dotnet-trace?

One of the primary use cases for gcdumps is analyzing the delta between two of them. The timestamp being in the default output name is to make it easy to quickly identify order of capture.

@josalem josalem mentioned this pull request Oct 23, 2019
@josalem

josalem commented Nov 1, 2019

Copy link
Copy Markdown
Contributor Author

Any opposition to merging this? The PR for the tool itself is essentially done (#581).

@josalem
josalem merged commit 7ab0fdd into dotnet:master Nov 1, 2019
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants