java – How can I increase the memory allocated to the application?

Question:

There are markers, they are added to the application. But at the same time, the memory allocated to the application suffers greatly. When this indicator reaches 132 MB in monitoring, the application freezes and crashes. Can this size be increased to 200 MB?

Answer:

The only way to increase the memory allocated to an application by the system is to set the android:largeHeap="true" flag in the manifest.

Use this flag only if you are sure that you have a resource-intensive application, for example, you are writing a game. In other cases, it is not recommended to do this, most likely you have leaks in the application, and you will still receive an OutOfMemoryError with increased memory.

Read more about memory and how to deal with leaks in the guide .

Scroll to Top