When using <m-frame> to partition a large MML-Document (e.g. a large world), a straight-forward approach is to use load-range and unload-range in 3d-web-experience. So when structuring an MML-Document properly into <m-frame "load-range":"*"> and keeping the maximum memory consumption of all m-frames loaded simultaneously under a certain threshold, practically open-worlds can be created.
This works perfect for loading and unloading, however, the memory allocated during loading is not deallocated when unloaded. This causes the heap to build up over time and eventually crash the application (client-side).
The vast majority of allocations comes from MML's ModelLoader.ts, which internally uses ThreeJS GltfLoader. Without getting into the weeds of the code, I assume that somewhere in the MML-Library a reference to the Data Array is not cleaned up properly when unloading an m-frame.
Expected behavior
When a is unloaded, the memory is freed. This eventually crashes the application after loading too many , even when the currently loaded m-frames only account for a fraction of the allocated memory.
Describe the bug
When using
<m-frame>
to partition a large MML-Document (e.g. a large world), a straight-forward approach is to useload-range
andunload-range
in 3d-web-experience. So when structuring an MML-Document properly into <m-frame "load-range":"*"> and keeping the maximum memory consumption of all m-frames loaded simultaneously under a certain threshold, practically open-worlds can be created.This works perfect for loading and unloading, however, the memory allocated during loading is not deallocated when unloaded. This causes the heap to build up over time and eventually crash the application (client-side).
Video: https://youtu.be/JFctnH2PCds
The vast majority of allocations comes from MML's
ModelLoader.ts
, which internally uses ThreeJS GltfLoader. Without getting into the weeds of the code, I assume that somewhere in the MML-Library a reference to the Data Array is not cleaned up properly when unloading an m-frame.Expected behavior
When a is unloaded, the memory is freed. This eventually crashes the application after loading too many , even when the currently loaded m-frames only account for a fraction of the allocated memory.
How to reproduce the bug
You can of course use other SRC-Documents as well.
Link to the code that reproduces this bug
No response
Packages
mml-web, mml-3d-web-experience
Package versions
v0.17.0
Extra details
No response