Android memory heap

来源:互联网 发布:mac ai cc 2017语言包 编辑:程序博客网 时间:2024/05/16 07:33

In frameworks/base/core/jni/AndroidRuntime.cpp:

#ifdef CUSTOM_RUNTIME_HEAP_MAX
#define __make_max_heap_opt(val) #val
#define _make_max_heap_opt(val) "-Xmx" __make_max_heap_opt(val)
    opt.optionString = _make_max_heap_opt(CUSTOM_RUNTIME_HEAP_MAX);
#undef __make_max_heap_opt
#undef _make_max_heap_opt
#else
    /* limit memory use to 16MB */
    opt.optionString = "-Xmx16m";
#endif

So you can define a CUSTOM_RUNTIME_HEAP_MAX with some other value,
e.g. "32m" to double the existing limit.

原创粉丝点击