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
{{ message }}
Repository navigation
!eeheap is reporting slightly inaccurate committed bytes. #3482
There are 2 cases where we are reporting slightly wrong numbers for committed bytes in !eeheap. The main problem is that, in general, the number of committed bytes is not exactly heap_segment_committed - heap_segment_mem. We typically have some space before heap_segment_mem to store something.
Case 1: Normal (i.e. not frozen) segments
For regions, the code is doing the right thing using regions_committed_adjustment, which should be sizeof(aligned_plug_and_gap).
For segments, this is currently wrong. The adjustment should be segment_info_size as in make_heap_segment. Depending on whether or not background GC is enabled, you could have either OS_PAGE_SIZE (which is OS-dependent) or align(sizeof(heap_segment)).
Case 2: Frozen segments.
The difference should be pseginfo->ibFirstObject as in GCHeap::RegisterFrozenSegment. In the frozen object heap implementation, we specified that as sizeof(ObjHeader).
The inaccuracies are typically small, off by a few bytes up to a page per segment at most.
In dotnet/runtime#72229 (and some earlier work), I introduced gc_heap::committed_by_oh and gc_heap::committed_by_oh_per_heap arrays. These arrays maintain the total number of bytes committed per heap and per object heap.
Whenever the inaccuracies are fixed, we should be able to compare the values stored in the array and the value reported by !eeheap and assert they are equal.
Activity
leculver commentedon Feb 27, 2023
@cshung Is it ok if I assign this to myself and start working on it?
cshung commentedon Feb 27, 2023
Sure
leculver commentedon Apr 15, 2023
I have fixed this in ClrMD. PR #3823 has the fixed version.