Open ww898 opened 1 month ago
Tagging subscribers to this area: @dotnet/gc See info in area-owners.md if you want to be subscribed.
That would require non-trivial synchronization since the generation bounds are constantly being updated by allocation. At the very least, this requires some careful design.
@cshung What do you think about creating the method like ICorProfilerInfo::ForceGC
, but without gathering garbage in fact?
Hi, my suggestion is based on the desire to get heap information updates not only at the beginning and end of GC, but also at any other time on request outside of GC. If the application does not perform GC for a long time after attaching the profiler, then we cannot make any assumptions about the amount of memory used. Calling
ForceGC
of course updates the heap information, but performs a full GC in addition, which breaks the picture of memory use.https://github.com/dotnet/runtime/blob/79a71fc750652191eba18e19b3f98492e882cb5f/src/coreclr/vm/gcenv.ee.cpp#L809-L855