Changes between Version 1 and Version 2 of MemoryUtils


Ignore:
Timestamp:
Mar 25, 2010, 11:32:05 PM (10 years ago)
Author:
gz
Comment:

document idom-heap-utilization

Legend:

Unmodified
Added
Removed
Modified
  • MemoryUtils

    v1 v2  
    124124
    125125[Function][[BR]]
     126'''idom-heap-utilization''' `&key unit (sort :size) (threshold 0.01) (area :tenured)`
     127
     128This function analyzes the core file heap based on dominance.  It takes a while
     129to compute, but often gives more meaningful results than the regular heap
     130utilization report, especially when looking at memory leaks.
     131
     132An object A is said to ''dominate'' another object B if all paths from gc roots
     133to B go through A.  A is said to ''immediately dominate'' B if A dominates B and
     134every other object that dominates B also dominates A.
     135
     136Since an object can only have one immediate dominator, all objects that are not
     137dominators themselves can be partitioned into disjoint sets, each consisting of
     138all objects with the same immediate dominator.
     139
     140If B is in the partition owned by A, i.e. B is not a dominator of anything and
     141is immediately dominated by A, then for all intents and purposes, B is just a
     142part of A: B will be garbage collected whenever A is garbage collected, and there
     143are no pointers directly to B from outside the partition.  Nothing about the behavior
     144of the heap would change if B was permanently appended to A instead of being a
     145separate object.
     146
     147`idom-heap-utilization` attributes the total size of all the partition members
     148to the immediate dominator.  I.e. it computes what `core-heap-utilization` would report
     149if the heap was flattened by attaching all objects to their immediate dominators,
     150and ignoring all types except the type of the immediate dominator.  This
     151tends to emphasize the types of objects that are really responsible for the memory usage.
     152
     153
     154[Function][[BR]]
    126155'''core-print-call-history''' `&key (stream t) origin detailed-p`
    127156