-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add a counter for gen0 budget #74217
Comments
I think this would be a good counter to expose and does make sense as a user facing feature as it tells you how much allocation will happen till the next GC. |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @tommcdon Issue DetailsBackground and MotivationThe gen0 budget can be used one of the signals to better understand when the GC is going to collect. It's not the only signal but it's an important one. Proposed FeatureToday that information is readily available as an GC event but not an event counter. We can either synthesize a counter in our diagnostic tools or emit a counter from the runtime. I don't have a preference but I would like to see the data along side other counters.
|
in theory, dotnet counter could enable the runtime provider + gc keyword + informational level to get the |
The only problem with that is we have to update all of the tools that show counters. APM tools, dotnet counter, visual studio, crank etc. |
why? I meant dotnet counter could enable the provider on the user's behalf. |
Right now counters emitted from the runtime have multiple consumers and they don't dotnet counters to consume metrics. There are different APIs:
So we need to decide how this data gets emitted from the runtime and how many pieces of consuming code need to change to get this new counter. Ideally we would reduce the amount of code consumers need to write. |
Any chance of getting this into NET 8? |
@cshung would you be interested in taking a look? |
@davidfowl - I can't speak to what the GC team might already have on their plate, but do you care about this request enough in .NET 8 to get the Platform complete deadline waived? |
If assuming it is trivial to add yes. If you told me we had to design a brand new set of APIs then I would say no. I would like to get this added in the next LTS (.NET 8) 😄. This information is important, and it is buried today, none of the tools show it. |
@cshung is this something that is easy to implement for .NET 8 or will it require new API's. |
It is not too hard to implement, but it will need a new API. I plan to address this (and the heap size one) after I have done some more diagnostics work related to dynamic GC. I definitely see the value in this and would love to have the counters. At the point, I am more worried that I may not be able to make it before the fork. We probably need a bit more design here as well. Do we just want gen 0 or other generations as well? The budgets are per heap, do we expose them all? I don't think we can expose multiple numbers in a metric, or have a variable number of metrics, how about some aggregates (average or max?) Also, do we want to have the value GC decided to give out, or the consumed one at the moment? Think of that this way, by the end of that last GC, GC decides that each heap can allocate 10 more megs before the next gen0 GC happens. You have allocated about 4 meg right now, should it report 10, or should it report 6? From an implementation perspective, there are a couple of issues that will be in our way.
Beyond these, I expect the API should not be too hard to implement. |
cc @reyang |
Background and Motivation
The gen0 budget can be used one of the signals to better understand when the GC is going to collect. It's not the only signal but it's an important one.
Proposed Feature
Today that information is readily available as an GC event but not an event counter. We can either synthesize a counter in our diagnostic tools or emit a counter from the runtime. I don't have a preference but I would like to see the data along side other counters.
The text was updated successfully, but these errors were encountered: