Issue with too much ram occupation on ios devices

I created a blank scene without any script and removed all packages, then i added a box with a material assigned to containing four 10mb textures(resolution: 4k -compression: normal) , then i made a Webgl1 build with brotli compression with .wasm format. (build size:28 mb)
An ios device with 1GB ram stuck on 90% while loading (which means there’s not enough allocated ram!)
while memory allocation limit on this device is 645mb.
how is it possible that such a small project decompressed and heap size exceed 645 megabytes ?!

this is the Editor log :

Build Report
Uncompressed usage by category (Percentages based on user generated assets only):
Textures               42.7 mb     75.9%
Meshes                 0.0 kb     0.0%
Animations             0.0 kb     0.0%
Sounds                 0.0 kb     0.0%
Shaders                151.9 kb     0.3%
Other Assets           5.7 kb     0.0%
Levels                 10.5 kb     0.0%
Scripts                270.5 kb     0.5%
Included DLLs          13.2 mb     23.3%
File headers           8.0 kb     0.0%
Total User Assets      56.3 mb     100.0%
Complete build size    85.4 mb
Used Assets and files from the Resources folder, sorted by uncompressed size:
10.7 mb     12.3% Assets/test size/4.jpg
10.7 mb     12.3% Assets/test size/3.jpg
10.7 mb     12.3% Assets/test size/2.jpg
10.7 mb     12.3% Assets/test size/1.jpg
153.2 kb     0.2% Resources/unity_builtin_extra
0.9 kb     Assets/test size/New Material.mat
4.1 kb     0.0% C:/Program Files/Unity 2019.1.4f1/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
4.1 kb     0.0% C:/Program Files/Unity 2019.1.4f1/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll
0.9 kb     0.0% C:/Program Files/Unity 2019.1.4f1/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll

After a long research, there are memory consumptions I know:

  1. WebAssembly code compiled size. If you have 30M uncompressed code size, It would eat-up 150M more or less
  2. Heap, depends on your game content and logic. Typically maybe 64M~256M
  3. Cavas, depends on resolution
  4. Textures, only support DXT compressed texture. On mobile, it will eat-up 4x memory more than desktop browser.
  5. Audio, WebGL build seams to heave some problem. Audio uses much more memory than apps.
  6. JS Memory, interact between C# and JS or some other allocation in JS.

If you sum them up, It would be much larger than you think.

Check out the about:memory tab in Firefox to get a good breakdown of where memory is going. See also this thread: Android Chromium - Unable To Grow Allocated Memory Above 256MB [Confirmed]

Those 4k textures are going to be loaded uncompressed on iOS Safari, at 67MB each. That’s 268MB only for textures.

Also, the allocation limit for a browser tab is lower than for an app.

Yep.On iPhone 6s/7/8, safari mem limitation is 1G, while app is 1.3G more or less.