Android Memory Optimization Summary

Source: Internet
Author: User

Having done Android for so long, summarize the memory-optimized points that you might normally use:

1, load Bitmap, if the picture is larger than the screen resolution, to reduce, if less than the original size load, while note 2.3 and the following system bitmap is allocated in native memory and 3.0 is in the heap of the virtual machine
2. Release and UI related resources such as bitmap, arrays, etc. at Ontrimmemory () level Trim_memory_hidden
3, the background task can use Intentservice to complete the use of Intentservice, because its own thread done after the service auto stop, will not affect the number of system process cached
4, the ability to use the system share memory using the resources such as the cursor buffer zygote process loaded
5, use optimized data containers such as Sparsearray, Sparsebooleanarray, and Longsparsearray.
6. Be aware of memory overhead such as enumeration type the RAM usage is twice times the static field on Android.

Android Memory Optimization Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.