You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been printing some logs in GCHeap::UpdatePreGCCounters and GCHeap::UpdatePostGCCounters and found that GCHeap::GetLastGCPercentTimeInGC can sometimes return 0 value when it doesn't seem to be correct.
When calls to GCHeap::UpdatePreGCCounters and GCHeap::UpdatePostGCCounters for one GC index happen between GCHeap::UpdatePreGCCounters and GCHeap::UpdatePostGCCounters for the other GC index, value of g_TotalTimeInGC becomes equal to the difference for previous gc index, which then makes g_TotalTimeInGC larger then _timeInGCBase and g_percentTimeInGCSinceLastGC is set to 0.
[GC_INFO] #6: Reason(0), Gen(1), Comp(1), Time start(4351468669403806 ns)
[GC_INFO] #6: Reason(0), Gen(1), Comp(0), Time start(4351468669403806 ns), Time end(4351468688324478 ns)
[GC_INFO] #7: Reason(4), Gen(2), Comp(1), Time start(4351468761984019 ns)
[GC_INFO] #8: Reason(0), Gen(1), Comp(1), Time start(4351468775666020 ns)
[GC_INFO] #8: Reason(0), Gen(1), Comp(1), Time start(4351468775666020 ns), Time end(4351468815018900 ns)
[GC_INFO] #7: Reason(4), Gen(2), Comp(0), Time start(39352880 ns), Time end(4351468825683517 ns)
[GC_INFO] #9: Reason(0), Gen(0), Comp(1), Time start(4351468960137950 ns)
[GC_INFO] #9: Reason(0), Gen(0), Comp(1), Time start(4351468960137950 ns), Time end(4351468968281329 ns)
As you can see, for GC index 7 diff between end and start (g_TotalTimeInGC) will be larger then (_timeInGCBase), which then will lead to 0 value of g_percentTimeInGCSinceLastGC.
Description
I've been printing some logs in
GCHeap::UpdatePreGCCounters
andGCHeap::UpdatePostGCCounters
and found thatGCHeap::GetLastGCPercentTimeInGC
can sometimes return 0 value when it doesn't seem to be correct.When calls to
GCHeap::UpdatePreGCCounters
andGCHeap::UpdatePostGCCounters
for one GC index happen betweenGCHeap::UpdatePreGCCounters
andGCHeap::UpdatePostGCCounters
for the other GC index, value ofg_TotalTimeInGC
becomes equal to the difference for previous gc index, which then makesg_TotalTimeInGC
larger then_timeInGCBase
andg_percentTimeInGCSinceLastGC
is set to 0.Is this the expected behavior or not?
Reproduction Steps
Patch to print log:
Then run crossgen2:
Expected behavior
non-0 value for
GCHeap::GetLastGCPercentTimeInGC
?Actual behavior
As you can see, for GC index 7 diff between end and start (
g_TotalTimeInGC
) will be larger then (_timeInGCBase
), which then will lead to 0 value ofg_percentTimeInGCSinceLastGC
.Regression?
No response
Known Workarounds
No response
Configuration
Tested on linux x64
Runtimes:
Other information
cc @alpencolt
The text was updated successfully, but these errors were encountered: