iOS VRAM Crash

Hi all, Im getting a crash/automatic refresh of my app on iPhone 13 when the user interacts and it ‘seems’ to be a VRAM issue.

When the app first boots, VRAM reads around 200Mb but then as I move the camera around (presumably forcing more visible textures into VRAM?) the VRAM usage increases.

If I move the camera slowly it eventually tops out at around 763MB and doesnt crash but if I move the camera too quickly the VRAM usage increases quickly as objects come into view (does this sound plausible?) and it crashes and restarts.

What can I do to resolve this?

Cheers

If you haven’t stumbled upon this yet, here are some usefull tips regarding performance in Playcanvas:
https://developer.playcanvas.com/en/user-manual/optimization/guidelines/

From my personal experience, what I usually end up doing is enabling BASIS-Compression on all my Textures. This greatly reduces VRAM, but it does come with a price in terms of visual quality.

Other than that I try to make sure to use 3D models optimized for the web, as well as bundling textures as much as possible. This is described a bit more in the link I sent in the beginning of my comment.
The link also mentions “Device Pixel Ratio” which has a big effect and is usually something I end up disabling.

The underlying issue is that iOS mobile devices caps VRAM usage at a MUCH smaller breakpoint than any other OS does for web-applications.

You can also use tracing to see what textures use the most memory: Debug logging of textures with their sizes in vram by mvaligursky · Pull Request #5358 · playcanvas/engine · GitHub

If you are targeting mobile phones, I don’t recommend going over 200-250 Mb in VRAM. Older iPhones will force close/restart the browser.