The code is at
https://git.eclipse.org/r/plugins/gitiles/mat/org.eclipse.mat/+/refs/heads/master/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/internal/DominatorTree.java
Looking at the variable names my guess is that it uses this algorithm:
Lengauer, T., & Tarjan, R. E. (1979). A fast algorithm for finding dominators in a flowgraph.
ACM Transactions on Programming Languages and Systems (TOPLAS), 1(1), 121-141.
This is actually a memory intensive part of the parse, requiring 7 int arrays of size the number of live objects, so for a 1,000,000,000 object heapdump requires 28,000,000,000 bytes of heap in MAT. For the maximum number of objects that
MAT can handle would therefore require 56GB of heap.
If you know about building dominator trees and want to propose a more memory efficient algorithm, or even better, have some code to contribute under the Eclipse Public License, then please tell us.
Andrew Johnson
From: mat-dev <mat-dev-bounces@xxxxxxxxxxx>
On Behalf Of Himanshu Vashishtha via mat-dev
Sent: Thursday, July 13, 2023 11:24 AM
To: Memory Analyzer Dev list <mat-dev@xxxxxxxxxxx>
Cc: Himanshu Vashishtha
Subject: [EXTERNAL] [mat-dev] Dominator tree/retained size computation
Hello Devs,
Is it possible to have some info on how MAT computes the dominator tree and subsequently the retained size of objects. I do see it does multi pass on the dump and creates multiple index files — but couldn’t find any doc/info as to how it
computes the tree/retained size.
(In case if reading code is the only way, a high level info will be helpful :))