Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using new GetGCMemoryInfo API when targeting net5.0+ #47

Open
rwkarg opened this issue Nov 27, 2020 · 2 comments
Open

Consider using new GetGCMemoryInfo API when targeting net5.0+ #47

rwkarg opened this issue Nov 27, 2020 · 2 comments

Comments

@rwkarg
Copy link

rwkarg commented Nov 27, 2020

This is extended information that may be able to pull GC info in a way that is less performance intensive.

Blog Post:
https://devblogs.microsoft.com/dotnet/the-updated-getgcmemoryinfo-api-in-net-5-0-and-how-it-can-help-you/

@djluck
Copy link
Owner

djluck commented Nov 28, 2020

So I have looked at this API and it's something I might consider for v4 but at the moment I'm leaning away from it:

  • it isn't clear how this API can be used to get information on all GC collections (do you endlessly call this method in a loop?) as it just seems to return metrics on the last collection that occurred
  • the overhead of listening to Info level GC events is actually quite low

@sywhang
Copy link

sywhang commented Feb 18, 2021

That API isn't meant to be used for getting info on all GC collections - for that using EventListener as this library currently does is the current recommendation.

GCMemoryInfo API can help you though, if you're interested in sampling. This is the backing API for some of the runtime GC counters published by CoreCLR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants