5
\$\begingroup\$

To make my game more fluid, I try to prevent memory allocations during the game I am writing. To that end, I allocate a whopping 16MB of buffers on startup and then use those as I go along. When I check in Eclipse my game now uses 24MB in total, which does not change noticeably during the game.

This all works fine on the phone I have now (android 2.3, motorola defy) but I wonder if I'm going to run into problems with this on other phones or tablets that run android 2.2 or higher (which is what I'm aiming for)?

\$\endgroup\$
1
  • \$\begingroup\$ For the record: I used the memory buffer for storing decoded images, so I could quickly load them to the gpu without having to make any allocations. I ended up loading all my bitmaps to the gpu on startup and scrapping the buffer, reducing my memory usage to 4MB. \$\endgroup\$
    – xastor
    Oct 19 '12 at 18:54
1
\$\begingroup\$

I do not think it has much to do with the android version you are running as well as de device specs you are aiming for. Most new tablets and phones have 512MB to 1Gb memory so even 24mb doesn't sound that much. It just a matter of choice, do you want to aim for high end devices or not.

\$\endgroup\$
0
1
\$\begingroup\$

I found this : https://stackoverflow.com/questions/3590443

Apparently the memory limit seems to be device specific and often related to screen density. This seems to correspond to my test device : my motorola defy has a high-density screen so propably has a 24MB process limit or higher. If I want to support older android 2.2 devices with low density screens, I should reduce my memory usage to 16MB.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.