Back to rules
RuleSource Checked

Dispose Three.js GPU resources explicitly

Remove stale geometries, materials, textures, and render targets when scenes change.

Checked July 12, 2026

Ready to use

Rule text

1 line
When a Three.js object leaves the application for good, dispose its geometry, materials, textures, and render targets. Removing an object from the scene does not release the GPU resources it allocated.

Why it helps

The reasoning behind the entry

Long-running editors and games can slowly exhaust GPU memory when scene teardown only removes object references.

Filed under

Use it in more than one place

Platform
Web