Find what leaks per scene reload
godot_leaksCycles a Godot scene headless to detect object and orphan-node leaks, reporting per-cycle growth with classes, scripts, scenes, and the code that creates or removes them.
Instructions
Run a scene in Godot 4.7 headless in cycles (load, run cycle_frames frames, free; or keep: true to keep it running), snapshot the live objects after each cycle and report what grows per cycle after the warm-up: orphan nodes by class, script and scene with the parent they were removed from, the code that makes them and the remove_child() that dropped them; nodes left in the tree; objects that are not nodes, with the classes Godot still held at exit (--verbose) and the static or autoload containers that grow. input replays a timeline in every cycle. An error result when objects or orphan nodes grow more than the budget per cycle (default 0). Compares with the last run with the same mode, cycle_frames and input (.godot/godotwright/leaks/).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "godot_leaks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keep | No | keep the scene running instead of freeing it each cycle | |
| path | No | project folder, or a file or folder inside it (relative to the server's folder; default: the current project) | |
| input | No | timeline replayed each cycle: "10 press load; 40 press unload" | |
| scene | No | the res:// scene to cycle (default: the main scene) | |
| cycles | No | cycles (default 5) | |
| warmup | No | first cycles not counted (default 1) | |
| cycle_frames | No | frames per cycle (default 60) | |
| timeout_seconds | No | timeout of the run (default 300) | |
| objects_per_cycle | No | allowed object growth per cycle (default 0) | |
| orphans_per_cycle | No | allowed orphan-node growth per cycle (default 0) |