Crash on iOS, smooth sailing on desktop

Oh hey, it’s me again.

Goal: Load ~100 files, each at ~1Mb, to display one at a time in an interactive movie.

Current progress:
This pg works great on PC but will crash my ios devices (iPhone12 Pro or iPad) in safari and private mode.

I’ve tried the following things:
17 files: crashes iOS
16 files: works perfectly

It doesn’t seem to be a memory issue as this 50 MB file loads just fine.

I’m not sure what to do next or test that could be the issue.

Hivemind, do your thing like you always do :wink:

Let me see if @Cedric and @bghgary might have an idea ?

#44 and #45 work on my iphone 11 with Safari. #40 crashes
Can it be related to number/size of index/vertex buffer allocated?

Is it crashing from GPU or “CPU” memory ? I unfortunately can not repro as I need a new phone :frowning:

I can see this error when using webInspector:

But nothing else.

ohhhh so it would be a crash ??? so I guess we should fix the crash and also is it following a context lost which would mean to much GPU memory ?

I see nothing else in the console. Is there anywhere else to check?

nope, might be just this crash then, so probably “easy”-ish to fix if you can repro :slight_smile:

I’m still investigating.
I did a test on my Android device (Android 11). it also crashes there and kills my browser.
On Edge on my desktop PC. It works but it allocates up to 4Gb of ram. :confused:

Error is simply because assetContainers[currentSceneIndex] was undefined.

Thanks for looking into this!

I wasn’t expecting all of the files to be loaded to the scene or kept in memory using the .addAllToScene and .removeallFromScene I assumed only one would be in memory. Because the draco encoded glb files explode in size when they are decompressed. I uploaded a 4Mb draco file to the sandbox and exported it as glb it is 52MB

Looking at your scene, there are meshes with a huge number of faces. I think there are areas of improvement on babylon side but your meshes are too big to fit in a browser memory.

We will do some test to improve caching and memory, this will take take. But it won’t be enough to properly handle your scene.

Thanks for your help on identifying the major issues. Would you take a look at this PG? It is working locally on my phone, it would just be nice to have confirmation that it works for others and that the memory usage stays low (chrome says it increases during each load even though its from the cache, but task manager shows the memory usage is stable).

I used an xhr to grab all the files first and then only open them one at a time, rather than having all the files decompressed in ram.

I am running into an issue given the async nature of the load, if you scroll too quickly on the slider things fall apart (trying to sort that out)

3 Likes

Wow! it’s definitely way way better. on Edge/Windows, memory stays at areoung 500Mb and it loops perfectly on my iphone. Nice!

1 Like

Hi @bscott711 just checking in to see if your problem has been resolved :smiley:

Thanks for checking in :slight_smile: I was finally able to sort out the issue I was having! Working example here