-
Notifications
You must be signed in to change notification settings - Fork 68
Description
When just loading the cube, there is no noticeable leak when disposing and recreating NativeEngine (though this might be due to it being tiny to start with). However, when loading a glb, there is a noticeable memory leak. For example, if we load https://raw.githubusercontent.com/microsoft/experimental-pcf-control-assets/master/surface.glb in the Babylon React Native Playground app, then each time we tap "Toggle EngineScreen" we leak about 30mb. I observed this in an iOS Release build (haven't tested debug or Android yet).
I also noticed a similar issue with XR. Even with just the cube, if I enter XR, and then hit "Toggle EngineScreen" (rather than stopping XR), it leaks around 120mb. I'm guessing this means we are not freeing up certain native resources when the JS NativeEngine is disposed. If the issue causing the leak for glbs does not turn out to be the same root cause as the leak for XR mode, then we should open a separate issue.