开发者

How can an Android app use >=256Mb of RAM?

As far as I'm aware, each Android phones limits all apps to a maximum memory usage of about 16, 24 or 32Mb. I've just seen people discussing the app Dungeon Defenders which apparently seems to make use of 256 Mb of RAM.

App description: "Minimum Requirements: 512 MB RAM (256 free at runtime)" http://www.appbrain.com/app/dungeon-defenders%3A-first-wave/com.trendy.ddapp

A guide on how to get this game to run on a Droid (where a custom ROM is require to get 256Mb of RAM free to run the game): http://www.forums.trendyent.com/showthread.php?447-How-to-play-Dungeon-Defenders-on-your- Motorola-开发者_C百科Droid-Milestone-(requires-root)

How is this possible? Does anyone know what is going on here? Having access to that much RAM would make certain projects I'm working on much easier to write so I'm very interested to know what this game is doing.


On the droidcon in Berlin, Germany, I heard that you can't increase the amount of RAM an application can use on the dalvik side. You can use all available memory on the native side so I guess the named application have implemented heavy memory stuff native in C using the NDK. Thats the only possible solution I know...

Update It wasn't the conference, it was a Google Lab visit at my university with Reto Meier and colleagues.


As far as i know Android is able to use more than 256MB of RAM since 2.2
However most phones shows less than they have, because there is always some Ram reserved for the system.


I'm using NDK for my app. and for my testing device when i take more than the 16mb limit (HTC magic, android 2.2) the app crashes and the system throws exceptions for invalid addresses access. So no, you can´t use all the memory you want neither from native side or from the java-managed side.

I've read about using different .so libraries and load them when running your app, but i dont know how it works or if its a viable workaround. Any suggestions?


If you do not need to render the image in real time, the answer is simple, just send the image to your server, with some image processing command, render it there, and send it back to Android. If your application requires >256MB RAM then you're going to severely limit a lot of your audience, and that's not good.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜