App crashes onload because of too much memory usage

Hello everyone,

I am have created a model viewer project to visualise a women’s face, this project has a mesh of size 1.26 MB and a texture of size 35 MB(the size of two other women’s model and texture are almost the same to the one I specified).

I am integrating this project package in the main project I am working on(the main project is developed using HTML/CSS/JS) which has three instances of this project showing different women’s model and when I try to access the other project it crashes in mobile phones(tried in higher spec android and iOS).

I have compressed the mesh from 40 MB to 1.26 MB and I tried to compress the texture from 35 MB to 5 MB and still it crashes.

When I saw the memory usage in the profiler, I saw it is taking up 270 MB worth for each model, and overall memory usage for the main project will come upto 1.3 GB.

I have also tried removing some part of the mesh so that the vertex buffer size comes down and it didnt make any difference in total memory used.

I tried to compress the texture using PlayCanvas texture compression feature, but the compression process did not complete and stopped in between. The process also took very long and the browser used to reload after sometime.

Can someone please tell me what am I missing/ what are the other ways in optimising the PlayCanvas package so that it uses less memory.

I have included the links to the project and launch page below.
Project: PlayCanvas | HTML5 Game Engine
Launch(with profiler on): PlayCanvas | HTML5 Game Engine

Thanks and regards

You have an 8K texture which is not support by our Basis compression system. I would reduce it to 4K and compress via Basis.

On what devices does it crash on?

Here is the same project with 4K texture and Basis ASTC compression: https://playcanvas.com/project/1050451/overview/f-f-vertex

Worth mentioning that most mobile devices only support 4K textures and the engine attempts to downscale anything larger down to the maximum supported size by the device.

In terms of optimisation, we have general guidelines here: Performance | Learn PlayCanvas

It was crashing in iPhone 12 pro max, 13 pro, 13, 11 and Oneplus 9R.

And u were right, when I compressed the textures from 8K to 4K the app didn’t crash. And the memory consumption was around 15 MB per model.

It was likely to be the VRAM usage crashing the page from the textures, especially on iOS devices.

1 Like

A post was split to a new topic: My game is crashing I think