Open
Description
When items are repeatedly added to and removed from new trees, the symbols stay and start clogging up the memory. Don't know if this is necessary by design or not.
My simple test:
const SymbolTree = require('symbol-tree');
const base = [];
for(let i=0; i<100; i++) {
base.push({ content: i });
}
for(let i=0; i<1000; i++) {
let tree = new SymbolTree();
let root = { root: true };
base.forEach(obj => {
tree.appendChild(root, obj);
});
let it = tree.childrenIterator(root);
for( child of it ){
tree.remove(child);
}
console.log(JSON.stringify(process.memoryUsage()));
}
Metadata
Metadata
Assignees
Labels
No labels