Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @Maoni0 |
|
Did you accidentally miss including a file containing GCMemoryInfoData? |
|
I see it in src/coreclr/src/System.Private.CoreLib/src/System/GC.cs, is that not what you are seeing? |
|
Large number of build legs is failing with: After closer look, these build errors are in Mono build. So you will need to do something to make the Mono build green. |
|
I wonder about this: size_t GetHighPrecisionTimeStamp() } qpf_us being an int64_t, there could be a round-off error on some systems. It's probably more precise and efficient to use a double qpf_interval_us = 1e6 / qpf and do return (size_t)(ts * qpf_interval) instead. |
|
I think the doc comment here needs a few words more: suggestion: But perhaps you can think of something better... |
|
@jkotas right, it was just mono build failures; I have since moved the definition of @PeterSolMS I've added details to the comment of Index and also changed the type of |
c17b3c4 to
629ab79
Compare
a34d27c to
36f0609
Compare
|
@marek-safar, what's the process of making it work for mono for this PR? obviously mono's implementation is not there yet. |
|
@PeterSolMS thanks so much for finding those!!! I'll make the corresponding changes a bit later today. |
08e650a to
317192e
Compare
You should just include the docs under triple-slash comments in the doc. The doc generation tool will use to populate the docs for newly added APIs. |
|
okie; I didn't know that was all there is for API doc... I thought we'd have sections that you don't see as code comments like "examples of using this API" and etc. |
We (and others) can always submit PRs to the docs repo to augment the content further after they're initially populated. We just use the doc comments to seed the minimum so we at least have basic docs for summary, parameters, etc. |
src/libraries/System.Private.CoreLib/src/System/GCMemoryInfo.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/GCMemoryInfo.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
It looks like this overload used to work, but it's now being changed to throw?
There was a problem hiding this comment.
well, because there isn't a mono implementation yet. I did this based on @marek-safar's suggestion but I dunno if I misunderstood him.
There was a problem hiding this comment.
@Maoni0 I think @marek-safar's suggestion originated from the assumption that this is a new API that we don't yet support and we should just throw exception for now. However, this API turned out to be an extension on the existing GCMemoryInfo, and, as Stephen pointed out, we already support part of it and I don't think we should regress what is already implemented.
We used to just leave fields that we don't yet support uninitialized in the GCMemoryInfo (we might not even support every single field right now) and I remember coreclr was doing the same at some point, when comparing between Windows and Linux, for example. My opinion is that we should leave the fields from the new API with the default value for now and just initialize the fields from the netcore 3.0 version. So instead of throwing, we could just create a new GCMemoryInfoData with just these 5 fields initialized and we'll add later support in the mono runtime for the rest of the api.
There was a problem hiding this comment.
I see; makes sense! does this look good to you? I'm throwing PNSE in the overload but changed the old API the way you suggested.
That's nasty... Maybe return a nullable value instead? Or |
|
I believe I've addressed all your concerns, @jkotas and @stephentoub, please take a look at the latest commit. the only thing I'm waiting on is the review from mono folks. @BrzVlad I have no experience doing this; just let me know if I did something wrong. |
Most of the changes inside GC are the following - All the info is updated at the end of a GC with the exception of BGC which needs special care. We maintain 2 BGC info data structures and one could be in the process of getting updated and if the user requests either BGC info or the last GC info which is also a BGC, we would return the one that's complete. See comments in code for a more detailed explanation. Fill in the after size data for all generations instead of just the affected generations. Timing info recording - + Changed the GC time recording from ms to us. Previously we did the timing analysis with events which also carry their own high res timestamps so in GC using ms is good enough. But now since we are returning the timing info we want to record it in us instead of ms. + Consolidated when we get end_gc_time. It was not including all of the GC work before (eg, decommit eph seg). And moving it to do_post_gc makes it easier for getting the GC info. + Not including the EE restart time for blocking GCs - the reason being restart takes very little time and by the time we get to the actual RestartEE the GC settings could be changed and it's not worth the effort to wait till RestartEE at which point we have to spend more effort to figure out which GC to attribute it to. + Maintain the running % Pause time in GC info.
|
this is good to go; I will wait till tomorrow noon and if I don't hear any objections by then I will merge. thank you all for your reviews; really appreciate your help! |
Most of the changes inside GC are the following -
All the info is updated at the end of a GC with the exception of BGC which needs special care. We maintain 2 BGC info
data structures and one could be in the process of getting updated and if the user requests either BGC info or the last
GC info which is also a BGC, we would return the one that's complete. See comments in code for a more detailed explanation.
Fill in the after size data for all generations instead of just the affected generations.
Timing info recording -
own high res timestamps so in GC using ms is good enough. But now since we are returning the timing info we want to
record it in us instead of ms.
it to do_post_gc makes it easier for getting the GC info.
get to the actual RestartEE the GC settings could be changed and it's not worth the effort to wait till RestartEE at which
point we have to spend more effort to figure out which GC to attribute it to.