Here is what helped
- Create an array that will contain all the elements added to the scene.
- When adding an additional element to the scene, add it to this array.
- In kill mode, run scene.remove ('item name') to remove them from the scene.
- Now iterate over the array and manually make all the elements undefined.
Thus, I was able to free more than 600 MB of memory messages by moving to another page.
Update Response by Mr. Oak and WestLangley Memory leak using three .js and many figures
In webGLRenderer after deleting the grid with
scene.remove( mesh ) ,
you can free memory with
renderer.deallocateObject( mesh );
You can free the texture with
renderer.deallocateTexture( texture );
Gaurav
source share