Open Tom-Render opened 1 week ago
I realised my example above, crucially, doesnāt invoke GltfImport.Dispose, hereās a version of the project which does invoke GltfImport.Dispose: https://we.tl/t-dzLqJbvrGf
Sadly, the memory leak is still present even after invoking GltfImport.Dispose:
For the sake of completeness, I should also note that I've now tested the example project in Unity 6000.0.25f1 and the leak still occurs.
First, thanks for the magnificent codebase š, this issue has me completely stumped so Iām pretty confident itās a bug. However, apologies in advance if itās not and thereās some elusive means of clearing gLTFastās memory use Iāve somehow missed in the included example project.
Describe the bug
Every time we load a new GLB model we can only partially remove it from memory. This seems to happen on every platform, but is particularly problematic for us on iPad, where our application will inevitably build up memory use over time and eventually crash. To clarify, each one of our models is optimised enough to be viewed individually but viewing them in sequence causes issues because we cannot completely remove their predecessors from RAM.
Files
A small example unity project (including a glb) which re-creates the issue and produces .snap files (unity memory snapshots) as evidence can be downloaded here: https://we.tl/t-jYf1k8LwRZ
To Reproduce
Expected behaviour
When the first and second memory snapshots are compared, memory usage should be nearly identical. We should be able to restore RAM usage to (roughly) the original amount it was before the GLB was loaded.
Screenshots
Desktop (please complete the following information):