Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

android - Dalvik Memory Allocation - How to change the default limits?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...