A project I am working on requires the user to be able to jump between scenes within the same WebXR Session.
After a lot of research, we found this topic: Jumping between scenes while in WebXR.
So we used @JCPalmer’s implementation as a starting point and now we are actually able to perform seamless navigations between scenes while in WebXR!
Now the problem is: everything works fine on PC with an emulator, but as soon as we use an actual device (a Meta Quest 2) we experience some OOM issues, which eventually cause the browser (or even the whole device) to crash and reboot.
After we perform a scene navigation, we actually dispose the previous scene and everything it contains, but still we see the “Free memory” value in the Meta Quest Developer Hub’s perform analyzer inexorably decrease after each navigation.
At this point I’m even running my tests with empty scenes to exclude there is something wrong with our contents.
Also, I was not able to identify relevant memory leaks in Google Chrome’s performance profiler.
I suspect it is something related to the memory allocated within the WebGL context itself, which is never released until the session is closed.
This seams to be confirmed when I run the command “adb shell dumpsys meminfo -d” after I have performed about 10 scene navigations in WebXR:
As you can see, the values of “GL mtrack”, “EGL mtrack” and “Other mtrack” increase by a lot after each navigation, and they almost clear up as soon as I close the WebXR session.
Another thing I notice, when I run the command “adb shell gpumeminfo -l -d”, is that the count of renderbuffers increases by one on every scene navigation.
Can someone help me sorting out what is going on?
All I found about the “mtrack” metrics is some sparse information, and I still don’t understand why they are growing so fast.
Thanks in advance and sorry for the very long question!