perfview icon indicating copy to clipboard operation
perfview copied to clipboard

fix the places where we are still using Gens.GenLargeObj incorrectly

Open Maoni0 opened this issue 1 year ago • 0 comments

there are still places that mention Gens.GenLargeObj but should include POH. in TraceManagedProcess.cs -

  • SurvivalPercent
  • OnEnd - when we update UserAllocated and GenSizeBeforeMB.
  • GetFreeListEfficiency - should filter out POH
  • GetAllocedSinceLastGCMB
  • GetUserAllocated - only in assert
  • AllocedSinceLastGCBasedOnAllocTickMB
  • GetUserAllocatedPerHeap - there's a remark about LOH; on new enough versions we always fill in size_before/size_after (but I don't remember if this was changed before or after we added POH)
  • GetHeapSizeBeforeMB - this one needs to get all generations. however while changing it I discovered it problems with PerHeapHistories. PerHeapHistories.Count is still 0 for BGC at OnEnd time because BGC' OnEnd is called during the processing of the HeapStats event while for blocking GCs it's at RestartEEStop. PerHeapHistories.Count is still 0 for BGC's HeapStats event because we have't called fire_pevents yet. I think we should fix this on the runtime side and call fire_pevents before calling do_post_gc in bgc_thread_function. also the handling of PerHeapHistories is questionable, for example, we should not have this line

if (_event.PerHeapHistories == null) { _event.PerHeapHistories = new List<GCPerHeapHistory>(); } in ProcessPerHeapHistory as it should always be allocated.

Maoni0 avatar Apr 17 '24 04:04 Maoni0