Android申请更大推内存 android:largeHeap

来源:互联网 发布:ios 高仿今日头条源码 编辑:程序博客网 时间:2024/05/01 05:06

SDK doc:


android:largeHeap
Whether your application's processes should be created with a large Dalvik heap. This applies to all processes created for the application. It only applies to the first application loaded into a process; if you're using a shared user ID to allow multiple applications to use a process, they all must use this option consistently or they will have unpredictable results.
Most apps should not need this and should instead focus on reducing their overall memory usage for improved performance.Enabling this also does not guarantee a fixed increase in available memory, because some devices are constrained by their total available memory.

To query the available memory size at runtime, use the methods getMemoryClass() orgetLargeMemoryClass().


具体增加多少可用内存还是跟device有关