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