Running out of VRAM on iOS

Another thing to try is to take a completely different app like https://playcanvas.com/project/612100/overview/seemore and see if it has the same issue

Or
https://playcanvas.com/project/422705/overview/virtual-voodoo

Cool tried that out:
The SeeMore build: Seemore - PLAYCANVAS
Max Page Memory: 113MB
Max JS Memory: 198MB

My build: bluestreakmath.com/game
Max Page Memory: 388MB
Max Javascript Memory: 1.07 GB

So clearly i need to reduce memory and manage it better. Ill do some compression and merge some “sprites” into single textures and see what that does

Update:
I did the same profiling with all audio downloads and playing disabled, ddropped a whole GB. I guess even with compression my audio is too big, will have to sort out how to do that better

Without audio, does it crash on iOS device in your tests? The memory difference does seem to be large that I would do check the memory usage both with and without.

Audio is decompressed in memory before use so whether it’s WAV or MP3 doesn’t really matter.

It does not crash now so it seems it was memory related. Now i will just have to figure out how to not have all FX and music in memory. I download them all in the beginning. I guess i could download them when they are played to reduce RAM, but network traffic would go way up as we would have to redownload everything. Any tips for that?

You shouldn’t have to redownload as it would be cached in the browser. Unloading the asset just removes it from memory.

It looks like according to the docs the resource is destroyed on asset.unload, so how would i get it back without redownloading it via the network?

You call this.app.assets.load(asset);. And it’s more than likely that the file is cached by the webview so you don’t have to wait for it to download again.

You can see it here where the first time it loads, it takes a while to load the assets. But the second time, it’s very quick.

https://developer.playcanvas.com/en/user-manual/packs/loading-scenes/#managing-assets-in-scenes

This worked - dropped my memory usage by like .75GB with this, thanks so much!