Dalvik Memory Allocation - How to change the default limits?

后端 未结 3 513
野趣味
野趣味 2020-12-10 17:41

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

相关标签:
3条回答
  • 2020-12-10 17:45

    You can change the default global heap size via adb shell setprop, for instance:

       setprop dalvik.vm.heapsize 128m
    
    0 讨论(0)
  • 2020-12-10 17:50

    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.

    0 讨论(0)
  • 2020-12-10 17:50

    You may change this by changing vm.heapSize item in the avd's config.ini. For example, you may write

    vm.heapSize=64
    

    in config.ini. If there is no such item, you may add a new one.

    However, please notice that vm.heapSize may be overridden by the skin. There is a hardware.ini in the skin's path, and it contains default settings of vm.heapSize and hw.ramSize which may override your value. To workaround this problem, you may set

    skin.path=720x1280
    skin.name=720x1280
    

    The numbers are not important, it must be in the (width)x(height) form.

    0 讨论(0)
提交回复
热议问题