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
Not sure – it’s interesting that GCCreateSegment events are still fired but the free ones are not symmetrical. As you say – it’s more of what the purpose was for the event. If they save them and match them to check for memory freed, that’s a bit of a break if things get recycled. Is there any case where regions get deallocated prior to the end of the process’s life? Like shrinking working set or such? I expect to see a similar even in such a scenario. Also, maybe @Brian Robbins has a different perspective of how the event gets used. I took a quick look and I don’t see it being of particular importance in Perfview, so I am not sure what it’s intended usage was.
In segments, when we call gc_heap::release_segment, we call virtual_free, so that the reserved address space is returned to the OS.
In regions, when we call gc_heap::return_free_region, all that does is that the region is returned back to a free list of regions so that they can be allocated again, we do not return the reserved address space to the OS (and currently, we aren’t even decommitting them)
For regions, we simply never release the address space back to the OS.
What do we use that event for? Firing an event at the point of return free region is not difficult, but it might not be the right thing to do, especially so if event listeners are using them to account for reserved memory.
Adding @CLR GC Core – I see that this was happening when release_segment was called – that no longer happens with regions GC. The ones where you say this passes is where GC Regions is not enabled. I don’t see any events that get fired in the regions equivalent - return_free_region. Maybe they know better there.
This is on Windows X64. It also fails on Linux x64/WSL. It passes on Windows x86 and MacOS x64.
I changed this test to run on net7.0 and it started failing. The test isn’t getting any EventPipeEventSource.clr.GCFreeSegment callbacks on net7.0 but does on 6 and 3.1. Does anybody know why? Is this a bug in the runtime?
From discussions with @cshung and @brianrob, we think it is better to restrict GCFreeSegment events to only pertain to the old GC, when it actually freed segments of address spaces rather than warping the new GC's instances of decommitting regions to correlate a GCFreeSegment event.
Given that PerfView does not use GCFreeSegment/GCCreateSegment events coupled with the fact that a new .NET 8 CommittedUsage event shows how much memory the GC committed with a breakdown of what exactly the memory is used for, there seems to be no need for GCFreeSegment/GCCreateSegment events, and we should not expect them anymore during a GC in .NET 7+
#4906 looks to update the tests to reflect our new expectations.
Not sure – it’s interesting that GCCreateSegment events are still fired but the free ones are not symmetrical. As you say – it’s more of what the purpose was for the event. If they save them and match them to check for memory freed, that’s a bit of a break if things get recycled. Is there any case where regions get deallocated prior to the end of the process’s life? Like shrinking working set or such? I expect to see a similar even in such a scenario. Also, maybe @Brian Robbins has a different perspective of how the event gets used. I took a quick look and I don’t see it being of particular importance in Perfview, so I am not sure what it’s intended usage was.
From @cshung:
In segments, when we call
gc_heap::release_segment
, we callvirtual_free
, so that the reserved address space is returned to the OS.In regions, when we call
gc_heap::return_free_region
, all that does is that the region is returned back to a free list of regions so that they can be allocated again, we do not return the reserved address space to the OS (and currently, we aren’t even decommitting them)For regions, we simply never release the address space back to the OS.
What do we use that event for? Firing an event at the point of return free region is not difficult, but it might not be the right thing to do, especially so if event listeners are using them to account for reserved memory.
Adding @CLR GC Core – I see that this was happening when release_segment was called – that no longer happens with regions GC. The ones where you say this passes is where GC Regions is not enabled. I don’t see any events that get fired in the regions equivalent -
return_free_region
. Maybe they know better there.This is on Windows X64. It also fails on Linux x64/WSL. It passes on Windows x86 and MacOS x64.
I changed this test to run on net7.0 and it started failing. The test isn’t getting any EventPipeEventSource.clr.GCFreeSegment callbacks on net7.0 but does on 6 and 3.1. Does anybody know why? Is this a bug in the runtime?
Here is where the test adds the callback: https://github.com/mikem8361/diagnostics/blob/fe19551047ad9890edb706812ecba3faa6e6f6c5/src/tests/eventpipe/GCEvents.cs#L213
The text was updated successfully, but these errors were encountered: