Three.js - exhaust memory

I use the built-in shape extrusion function to extrude a shape along a spline. I create a new mesh every time I move the spline nodes. But this is so my RAM is full very quickly. Every time I create a new grid, I delete the old one with

scene.__removeObject(mesh); 

but does not free up used memory. I tested Firefox Nightly and Chrome, and both crash if the memory is full.

I searched for a general WebGL function and for a solution related to Three.js, but found nothing.

Maybe someone with a lot of WebGL / Three.js knowledge might give me a hint. Thanks you

+6
source share
1 answer

Make sure you are not referencing the javascript mesh object elsewhere so that the garbage collector can delete it.

+1
source

Source: https://habr.com/ru/post/914587/


All Articles