x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.20
Tags:
more ▼

asked Dec 10 '18 at 05:42 PM in Packaging & Deployment

avatar image

USER395425
10 2 7

avatar image USER395425 Dec 10 '18 at 06:08 PM

I also tried to turn on Texture streaming, reduce the maximum size to 512 and even 64 pixels, disable the alpha channel in textures, set the default material as MaskedUnlitSpriteMaterial, enable MipMap in the texture settings, turn off texture filtering, but that doesn't help either.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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:

https://www.unrealengine.com/en-US/blog/debugging-and-optimizing-memory

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

more ▼

answered Dec 10 '18 at 10:35 PM

avatar image

Shadowriver
37.2k 936 172 1116

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I remade some textures, now the game runs on 768 MB.

more ▼

answered Dec 13 '18 at 02:57 AM

avatar image

USER395425
10 2 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question