【Android】What is the role of android:largeHeap?

What is the role of android:largeHeap?

1. What is android:largeHeap used for?

android:largeHeapProperty used to specify whether the application requires larger heap memory. If your application requires larger heap memory, you can set this property to true. By default, this property is set to false.

When an application requires larger heap memory, it can use Runtime.getRuntime().maxMemory()the method to obtain the maximum heap memory. If android:largeHeapthe property is set to true, maxMemory()the method will return a larger value.

Here are android:largeHeapexamples of usage of the attribute:

<activity android:name=".MyActivity"
    android:largeHeap="true" />

In the above example, MyActivitythe activity will use larger heap memory.

Guess you like

Origin blog.csdn.net/weixin_42473228/article/details/130989104