Not enough RAM for textures to run the game on android
Hi, I finished developing the game, but it doesn't start on the android phone, the reason for it is not enough RAM. On iOS, the game works well, but there is enough RAM. My android phone has 512 MB of RAM. I conducted an experiment, started the game in the emulator NOX Player, with 2048 MB of memory and the game works, with 512 the game doesn't work.
Size of all my textures (PNG files 55 MB)
Size of the imported textures in the UE Editor 91 MB
Textures have size 256 to 1024. There are 80 of them.
.apk game file 168 mb
The number of sprites in the largest level is 407. In the other levels it is less, approximately from 20 to 100.
In the game I have 111 levels, while playing game only one at time is used, an unnecessary level is unloaded when moving from one location to another.
I can't understand why the phone doesn't have enough memory, because the size of all the textures may well fit several times in 512 MB.
Maybe somehow I can limit the memory for textures or somehow unload textures that are not in the field of view of the camera?
You need to remember that on android you not alone like in the console, on that 512MB ram and all android services sleeping applications are still there taking ram. You also need to remember GPU can't read PNG, in memory textures are uncompressed, or compressed in other GPU compatible lossless format, so they can be sampled by GPU, they take a lot more space then they do in file. Also textures are not only thing taking memory, there other things in engine that takes a lot of memory.
Insted of jurging things by the size of files you should do proper memory profiling to see what takes space, here some tips:
Also build Android to all texture formats, so proper one is used for your device
512MB is quite low end device for today standards, so it's not really suppricing that UE4 choke on it to begin with
I remade some textures, now the game runs on 768 MB.
answered Dec 13 '18 at 02:57 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here