Find what retains a class
findRetainersIdentify what retains a specific class by walking the cycle forest of a .memgraph file. Returns all retain chains ending in nodes matching the given class substring.
Instructions
[mg.memory] Walk the cycle forest from a .memgraph and return every retain chain that ends in a node whose className contains the given substring. Useful for answering "who is keeping alive?". Returns paths from a top-level node down to the matching node.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to a `.memgraph` file. | |
| className | Yes | Class name (or substring) to find retainers for, e.g. "DetailViewModel". | |
| maxResults | No | Cap on how many retain chains to return (default 10). |