ThreeJS with iOS issue

this question is about iOS. When I try to render some objects in iOS 12 IPhone 7, The application is crashing automaticly, I remember in iOS 11 the same application running , so, I don’t found too much about it. I think is something with the textures but I’m not sure, In android runs well, but iOS says “The webpage was reloaded because a problem occurred”, then, the applicacion not reload anymore, is when the scene’s objects are starting rendering on the scene. I hope you can help me on this.

Impossible to help you without knowing what your application is doing. Could you re-create an example that others can test and look at?

Thanks for answer. Yes, I have the applicacion running in my server: http://52.10.232.108:7900 Have a loader and then translate the camera when all the objects was successfully downloaded. The scene is rendering in this case, but when is added, I delete the loaded and show the scene. this proccess to show the scene is crashing in many iOS devices , everything with iOS12.

I can guarantee you it’s a memory issue. You’re loading a huge amount of assets, and just your first 17 assets add up to over 35 megabytes.

02%20PM

You should optimize your textures, geometry, and any other assets you’re using so they don’t consume so much of your device’s memory. Load smaller images, use low-polycount geometry, etc.

Yes, I’m very sure that the issue have to be that, but Why is rendering in many android devices? is weard. I have this second demo, https://o-zone.io/bottle/ that is working now because the designer reduce the texture quality to half. You have to click the drop and then start an animation with 3 models. when the second models was rendered, the application crash with the same issue.

I don’t know why it’s rendering in Android devices and crashing in iOS. But I’d be willing to bet that the two have different memory management and allocation methods.

Yes, and is when the objects was passed to the texture memory (textures, geometries, etc) is when the problem is happening, not when is loading

I can confirm that on iOS (for any application) if the OS is low on ram your process will be closed without any warning, this is normal behaviour for iOS.

Note that your scene uses 576MB of ram in Chrome on my desktop machine according to Chrome Task Manager. You’d probably need to remove most of the scene then add stuff back in to see what’s using up the most ram etc. Textures may be compressed or small files but when they go to the GPU is believe they are uncompressed bitmaps of the given size. Spector.js might help you diagnose how much work you are doing (https://spector.babylonjs.com/)

Thanks @webprofusion , I will try with Spector and let you know, When textures go to GPU is the problem, I think , the model have a lot of textures, and the memory is collapsing. we are using a lot of textures so. Thanks