THotPDF.BuildLoadedObjectDependencyGraph Method
Builds a deterministic dependency graph for the current loaded document and attributes estimated retained memory through the Catalog-rooted dominator tree
Declaration
function BuildLoadedObjectDependencyGraph(
out Nodes: THPDFObjectDependencyNodeArray;
out Edges: THPDFObjectDependencyEdgeArray;
out AInfo: THPDFObjectDependencyGraphInfo;
MaxObjects: Integer = 250000;
MaxEdges: Integer = 2000000
): boolean;
Nodes
EstimatedShallowBytesincludes the object instance, directly owned values, dictionary keys and lists, and resident in-memory stream payloads, but excludes referenced indirect objectsEstimatedRetainedBytesadds the shallow bytes of every Catalog-reachable object dominated by this node, counting shared dependencies only onceImmediateDominatorObjectNumberand its generation identify the nearest mandatory owner, or-1for the Catalog and unreachable objects- Incoming and outgoing counts preserve reference-slot multiplicity, while
ReachableFromCatalogdistinguishes live document structure from detached objects
Edges and bounds
Each edge records source and target object identities, the dictionary or array path of the reference slot, and whether the target resolved exactly by object number and generation
The method rejects object or edge counts above caller-selected limits, direct-object containment deeper than 256 levels, malformed direct containment cycles, and dominator analysis that exceeds 128 convergence passes
Memory values are portable estimates for attribution and comparison rather than allocator-exact process measurements