The .NET CLR's Garbage Collector compacts the heap. I take this to mean t开发者_Python百科hat as it sweeps through to remove unmarked objects, the next (still live) object on the heap gets moved up. Hence, from my understanding, compacting moves objects. When those objects are moved, does the move impact the Allocated Bytes/Sec performance counter? Or is this counter simply how many bytes added onto the heap?
According to this article on GC perf counters, the "Allocated bytes/s" counter is accounting for the number of allocated bytes for objects in Gen0 and LOH. Since the Gen0 is always emptied after each Gen0 GC and LOH is never subject to defragmentation, it should not affect this metric.
精彩评论