Max Texture Memory

I've been hearing (well, reading) a lot about texture memory and how your app with Corona should be as low as possible. My question is what's the max texture memory for devices? I know it varies for Android device, but is there a good 'rule of thumb'? What about the iPhone?

1
2
3
4
5
6
7
8
9
10
local monitorMem = function()
 
        collectgarbage("collect")
        print( "\nMemUsage: " .. collectgarbage("count") )
        local textMem = system.getInfo( "textureMemoryUsed" ) / 1000000
        print( "TexMem: " .. textMem )
 
end
        
local memTimer = timer.performWithDelay(1000, monitorMem, -1)

Keeping it under 25MB seems to be the general rule - that comes from the 3GS which starts to suffer if you hit 25MB. Under that it should run well on most/all devices we support.

Obviously the lower the better.

Peach :)

What about iPhone 4s? Are we able to target only iPhone 4/4s devices?

Thank you for your quick answer!

A game I was working on only started crashing on iPad when going over 100MB texture memory. That's right, 100MB. Until then it did work fine, but there were memory warnings on the debugging console. On iPhone 3GS it started crashing at about 80MB. Performance never suffered a bit, until the crashes, in the case of that particular game. On Android it will always be limited by the Java VM Max Heap Size value which is usually 32MB in compatible phones (2.2+) and 48MB on Tegra based tablets. The thing is that this is the total memory a program may use at any given time, so your texture memory usage should be lower than this. About 24MB seems to run on all devices so far.
If you're targeting iPhone4/S and iPad only then you can probably go all the way to 64MB without worries. The best way to know for sure is to "listen" for memory warnings when running on the device.
PS: If you can guarantee that you NEVER load more than the aforementioned 24MB of textures at once on an Android device you can use a lot more texture memory than that. This is because once the images are loaded into memory they will be garbage collected from the Java heap, because the rendering process is all native code. Java is only needed to load the images into memory if I understood correctly the way Corona works on Android.

@CluelessIdeas

Thanks for the info! I was wondering about the "breaking point" of different devices.
Really helpful.

Values in the literature for iOS devices & single apps are the following:

installed memory: 128 MB --> memory warning threshold: 20-25 MB

installed memory: 256 MB --> memory warning threshold: 80-90 MB

installed memory: 512 MB --> memory warning threshold: 260-300 MB (estimated)

What about memory usage for mobile devices?

*edit I just saw @RAoM_games post. It's like RAoM_games read my mind.

views:2054 update:2012/1/4 9:12:54
corona forums © 2003-2011