Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Graphics Memory Limits

I am creating an android game using opengl and a cocos2d port (http://code.google.com/p/cocos2d-android-1). I am targeting a wide range of devices and want to ensure that it performs well. I only test on a nexus one and am hoping to get some input from people with experience on slower devices.

Currently the game uses two 1024x1024 textures as well as two 256x256 textures. Is this within the limits of most devices? Anyone have any rule of thumb or experience with graphics memory limits in these cases? If gfx memory is exceeded does it page to normal memory?

like image 469
ghempton Avatar asked Dec 21 '10 01:12

ghempton


People also ask

How much memory can an Android app use?

Checking How Much Memory Your App Can Use Android supports devices with as little as 512 MB of RAM. Make sure you remember low-end devices too!

Does Android have VRAM?

The GPU: The graphics adapter in your phone needs memory to operate. That's called VRAM, and our phones use integrated GPUs that have no stand-alone VRAM. System RAM is reserved for this.

How does Android RAM fit everything?

In order to fit everything it needs in RAM, Android tries to share RAM pages across processes. It can do so in the following ways: Each app process is forked from an existing process called Zygote. The Zygote process starts when the system boots and loads common framework code and resources (such as activity themes).


2 Answers

Java Apps are 16Mo (mdpi) or 24Mo (hdpi). But Native aren't and OpenGL Java API is only a JNI wrapper. So you can load on GPU more than 24Mo of texture. My experience was to limit Atlas at 512*512 at first (because G1 was slow on big textures) but today i use bigger atlas texture.

Our current games use 20-50 Mo of ram and use 2048*2048 textures.

like image 126
Ellis Avatar answered Oct 29 '22 20:10

Ellis


Old post I know but nowadays your talking at least 128mb in the VM for available loading space on Bitmaps in memory using android java.

With textures you are loading outside the app space (c). So the loading limit is the same as the phones memory. (You'll notice on memory intensive games that the icons draw when going back to the home screen)

like image 34
Oliver Dixon Avatar answered Oct 29 '22 21:10

Oliver Dixon