THotPDF.BuildLoadedObjectDependencyGraph Method
为当前已加载的文档构建确定性的依赖图,并通过以 Catalog 为根的支配树来归因估算的保留内存
声明
function BuildLoadedObjectDependencyGraph(
out Nodes: THPDFObjectDependencyNodeArray;
out Edges: THPDFObjectDependencyEdgeArray;
out AInfo: THPDFObjectDependencyGraphInfo;
MaxObjects: Integer = 250000;
MaxEdges: Integer = 2000000
): boolean;
Nodes
EstimatedShallowBytes包含对象实例、直接拥有的值、字典键和列表,以及驻留在内存中的流载荷,但不含所引用的间接对象EstimatedRetainedBytes累加了该节点所支配的、从 Catalog 可达的每个对象的 shallow 字节数,共享依赖只计一次ImmediateDominatorObjectNumber及其 generation 标识最近的必经所有者;对 Catalog 和不可达对象则为-1- Incoming and outgoing counts preserve reference-slot multiplicity, while
ReachableFromCatalogdistinguishes live document structure from detached objects
Edges and bounds
每条边都记录源与目标的对象标识、引用槽位的字典或数组路径,以及目标是否按对象号和 generation 被精确解析
以下情形会被该方法拒绝:对象数或边数超过调用方选定的上限,直接对象的嵌套深度超过 256 层,存在畸形的直接包含环,以及支配者分析超过 128 轮收敛
内存数值是便于归因和比较的可移植估算值,并非分配器层面精确的进程度量