Find what grows per cycle
three_leaksRepeats a defined open/close cycle with garbage collection and reports per-cycle growth in GPU resources, scene objects, scenes, JS heap, and undisposed items by type to expose three.js memory leaks.
Instructions
Repeat a cycle of steps (open and close a level, add and remove objects: e.g. {"type":"eval","js":"app.load(); app.unload()"}) several times with garbage collection after each, and report what grows per cycle: GPU geometries, textures and programs, scene objects, scenes still alive, JS heap, and the resources that reached the GPU and were never disposed, by type (SphereGeometry, MeshStandardMaterial, Texture robot.png). Fails over the budget (default: no growth). Run it again after the fix to show 0 per cycle.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target": "<target>",
"cycle": "<cycle>"
},
"name": "three_leaks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | folder to serve when the page needs files above its own folder | |
| wait | No | ||
| cycle | Yes | the steps of one cycle (same step types as three_play) | |
| entry | No | ||
| setup | No | Steps in order: {"type":"click","selector":"#start"} or {x,y}, {"type":"press","key":"Space"}, {"type":"hold","key":"ArrowRight","ms":300}, {"type":"drag","from":[x,y],"to":[x,y]}, {"type":"wheel","deltaY":200}, {"type":"wait","ms":500}, {"type":"wait-for","selector":"canvas"}, {"type":"frames","n":10}, {"type":"eval","js":"app.start()"}, {"type":"until","js":"$('ball').position.y < 0","timeout":5000}. | |
| width | No | ||
| budget | No | growth allowed per cycle | |
| cycles | No | default 5 | |
| height | No | ||
| ignore | No | ||
| target | Yes | Folder with the page (index.html), or the http(s) URL of a running dev server. | |
| webgpu | No | ||
| warmup_cycles | No | cycles not counted (default 1) |