Greetings!
I'm currently facing a memory handling issue. Despite researching various forums, I am still unable to identify the problem in my code.
My project involves combining d3.js with three.js to create a visualization of nodes resembling planets orbiting in space. The data is extensive, with over 8,000 planets distributed across 8+ orbits. However, every time I attempt to load new data, I encounter difficulties in destroying the existing tree without causing memory leaks.
I would greatly appreciate any assistance! Below is a snippet of the code where I generate planets and attempt to destroy them:
function initTree(root) {
// Code for initializing tree and creating planets
}
After adding spheres to the parent Object3D and then to the scene, I have implemented a function to destroy these elements:
function destroyTree() {
// Code for destroying spheres, objects, and other elements
}