tags:

views:

73

answers:

1

I am currently considering to develop an application for processing of images captured by the camera of mobile phones using the Android OS. Before I make the decision to go forth, I have done some research and found out there are some complaints regarding the limits of the memory allocated by the Dalvik VM, which seem to be limiting to applications that require manipulation and processing of images. Which limits should i have in mind if i would have to process for example 3 photos taken with the camera, in my process, applying filters, transforms and other types of mathematical operations?

I would like to know if it is possible to change the default value of memory allocated by the Dalvik VM for each application (this default is of 16 MB), in any way, using the Android 1.6 OS. Has anybody looked into this that can help me out please?

I have also read in the Android 2.1 compatibility definition document (available here: http://static.googleusercontent.com/external_content/untrusted_dlcp/source.android.com/pt-PT//compatibility/android-2.1-cdd.pdf ) that it is possible to change the allocation of memory by the Dalvik VM from 16 MB to 24 MB or even a bigger amount if it is necessary, but it is not mentioned anywhere how this can be done.

If someone has looked into those issues before and could give me some help or hints, it would be greatly appreciated. Thank you.

+3  A: 

On a usual device you cannot change the heap-limits of your application. They are hardcoded by the OEM. If you are developing for some device of which you have full control, you can modify Dalvik startup scripts to allow more heap space.

Reflog
Do you have information on how to modify Dalvik startup scripts regarding higher default heap size per app? Does the phone need to be rooted for that? I'm developing an app that will be bundled/distributed together with a device, where I'd be in full control, not rooted (yet) though.
Mathias Lin
you need to have a complete access to the phone, modifying startup scripts means a root acceess.in case u have a root access - edit init script (it's in root /init.rc)and look for "setprop ro.FOREGROUND_APP_MEM 1536 "
Reflog
For Dalvik's managed heap limit, you want to edit vendor/[company]/[product]/system.prop and add or update "dalvik.vm.heapsize=24m". This ends up in /system/build.prop, and eventually turns into a -Xmx argument.
fadden