Skip to content

Conversation

@dramos020
Copy link
Contributor

@dramos020 dramos020 commented Nov 30, 2022

Adds the profile mentioned in #3521 in order to include private gc events in the gc-collect profile. Can see this working by using the following sample application:

using System.Collections;

class ConsoleTest{
    public static void Main(){
        List<int> nums = new List<int> {};

        Console.WriteLine("Currently Running");
     
        while(true){
            List<object> objects = new List<object>();
            for (int i = 0; i < 100000; ++i)
            {
                objects.Add(new object());
            }
            objects.Clear();
        }
    }
}

and dotnet-trace to collect a trace:

dotnet-trace collect --profile gc-collect -n sampleapp

This results in the following events being generated, making note of the private gc events:
private gc events

@dramos020 dramos020 marked this pull request as ready for review January 10, 2023 18:55
@dramos020 dramos020 requested a review from a team as a code owner January 10, 2023 18:55
@dramos020 dramos020 requested a review from davmason January 10, 2023 18:56
Copy link
Member

@hoyosjs hoyosjs left a comment

Choose a reason for hiding this comment

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

LGTM

@hoyosjs
Copy link
Member

hoyosjs commented Jan 10, 2023

cc: @cshung @Maoni0

Copy link
Member

@tommcdon tommcdon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Maoni0
Copy link
Member

Maoni0 commented Jan 10, 2023

thanks @hoyosjs! I'm curious why those rundown events are there even though they are not in the list of events we collect for this profile?

@davmason
Copy link
Contributor

Currently dotnet-trace is hardcoded to always request rundown, the true as the second parameter here is to request rundown:

session = diagnosticsClient.StartEventPipeSession(providerCollection, true, (int)buffersize);

We should generally have an option to skip rundown, I opened #3597 to track it.

Copy link
Contributor

@davmason davmason left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Daniel!

@dramos020 dramos020 merged commit 21dbb38 into dotnet:main Jan 10, 2023
@Maoni0
Copy link
Member

Maoni0 commented Jan 10, 2023

great, thanks @dramos020 for doing this work, and @davmason for the new issue!

@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants