Original: Android Project Combat (12): A lazy and effective way to solve oom
Add android:largeheap= "True" to the application node of the program's manifest file.
Yes, just a word!
So what does this line of code mean?
Simply make the app get the maximum amount of memory that can be allocated in order to solve the oom problem,
However, the cause of the oom problem is always two points:
1, a cell phone memory is really very small
2, code problems, such as the size of the bitmap picture is not handled well
It can be said that the situation of Oom is basically the second situation, then you need to modify the code to see where not handled well.
So for the application to use: Android:largeheap= "True" This method solves the problem of Oom is only a way to cure the symptoms
Therefore, we can use largeheap for images or video applications where memory requirements are too large.
Some people say that using this line of code will have an impact on the GC, and some say no. Bloggers here are not sure, you can check the Internet.
--------------------------------------------------------------------------------------
Finally add a sentence, not recommended to use.
Android Project Combat (12): A lazy and effective way to solve oom