I have a three.js interactive program that is loading multiple models. After the initial run, the program resets, removing all the models and clearing out all of the variables, but the memory usage does not decrease.
The .json models are taking up a lot of memory, which is interfering on many levels. We are trying to reduce the size of the models, but that is only going to go so far if the memory can't be reallocated.
From the research I've done, .deallocate() has been deprecated. I am loading using THREE.ObjectLoader(), so I'm not sure how the .dispose() would work in that instance. I tried:
scene.remove(basketContents[type][i]);
basketContents[type][i].geometry.dispose();
basketContents[type][i].material.dispose();
basketContents[type][i].texture.dispose();
But that gives me errors that .geometry.dispose(), etc. does not exist.
How can I remove the object from memory so that the memory can be used for other objects?