Closed alvarosabu closed 5 months ago
Sure thing! I'll have a look.
I feel like the answer to "Should this be disposed?" is hard to explain. And that means the implementation will be easy to break in the future.
Tests would probably help both in explaining the functionality to maintainers and in ensuring future changes don't accidentally break the functionality.
At first glance, I don't see any tests about resource disposal. Would you like me to add some tests?
Before the tests @andretchen0 , I'm struggling to dispose the whole scene on the unmount hook of the TresCanvas when changing a route, the GPU is clear but not the CPU memory allocation 🥲. I will push the latest code I used to try to make it work
Before the tests @andretchen0 , I'm struggling to dispose the whole scene on the unmount hook of the TresCanvas when changing a route, the GPU is clear but not the CPU memory allocation 🥲. I will push the latest code I used to try to make it work
Sure thing.
Can you walk me through the steps you're taking – in the Chrome dev tools? – so that we're looking at the same data?
Hi @andretchen0 here is a video with the reproduction steps
https://github.com/Tresjs/tres/assets/4699008/bbb57f9e-6b0f-48fe-90ac-8c0b67ce9641
I think I found the reason @andretchen0, the refs kept on the CPU are entirely related to the devtools. This doesn't occur in production build.
I think I found the reason @andretchen0, the refs kept on the CPU are entirely related to the devtools. This doesn't occur in production build.
I came here to post this. Lol. 👍
Hey buddy @andretchen0 can you take a look to this one, I think I would prefer to tackle the test in the #631 task
Hopefully closes #449
dispose
functionTodo