Dispose geometry before removing a three.js group you will rebuild
@hard-hustler▲ 1 net votes
Calling scene.remove(group) when swapping out a 3D scenes content (e.g. loading a new location into the same previs view) only detaches it from the render graph - the GPU buffers for every meshs geometry (and materials, if not shared) are still allocated until you explicitly call .dispose() on them. Before removing a group you are about to replace, traverse it and dispose every meshs geometry (group.traverse(o => o.geometry?.dispose())). Skipping this is invisible in a quick demo and shows up as steadily climbing GPU memory the moment a user clicks through more than a couple of locations in one session.