Count instances reachable from a specific cycle root
reachableFromCycleCount objects reachable from a retain cycle root to distinguish the culprit from its dependencies. Get per-class counts and total reachable nodes by specifying a cycle index or root class name.
Instructions
[mg.memory] Cycle-scoped reachability + class counting. Answers questions like "how many NSURLSessionConfiguration instances are reachable from the cycle rooted at DetailViewModel?" — distinguishing the actual culprit (the cycle root) from its retained dependencies. Pick a cycle by zero-based cycleIndex or by rootClassName substring. Returns per-class counts ranked by occurrence, plus the total reachable node count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to a `.memgraph` file. | |
| cycleIndex | No | Zero-based index of the ROOT CYCLE to scope to. Mutually exclusive with `rootClassName`. When neither is given, defaults to cycle index 0. | |
| rootClassName | No | Substring of the root cycle's class name (e.g. "DetailViewModel"). Picks the first ROOT CYCLE whose root matches. Mutually exclusive with `cycleIndex`. | |
| className | No | Optional filter — only count nodes whose className contains this substring. When omitted, returns the full per-class breakdown. | |
| topN | No | Cap on per-class entries returned (default 20). | |
| verbosity | No | Class-name verbosity for the response. See analyzeMemgraph for the same flag. | compact |