问题描述
我们毕业项目中的软件团队要求增加Android中每个进程的堆大小。他们说默认是16MB,这对他们来说是不够的。
我如何自定义大小?
The software team in our graduation project asked for increasing the heap size per process in Android. They said that the default is "16MB" which isn't sufficient for them.How could I custom the size?
我在文件中发现了一条注释行: /acme/my_board/BoardConfig.mk
在我的Android源代码中:
I found a commented line in the file: /acme/my_board/BoardConfig.mk
in my android source code:
# USE_CUSTOM_RUNTIME_HEAP_MAX := "64M"
是否需要编辑?
推荐答案
我通过android平台邮件列表获得了答案
I got that answer through android-platform mailing list
例如,要使其为32MB,您可以在
For example to make it 32MB, you can do below
gDvm.heapSizeMax = 32 * 1024 * 1024;
另一个建议的方法是更新您的
Another suggested approach is to update your system.prop
问候,
Muthu S ubramaniam
Regards, Muthu Subramaniam
这篇关于Android平台中的自定义堆大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!