Android Picture Memory issues

Source: Internet
Author: User

In the Android development process, often encounter oom problem, for many reasons, one of the most difficult to deal with is the picture caused by oom, so on the network compared to several images loaded library, finally chose the Facebook Fresco library (GitHub address: https:// Github.com/facebook/fresco).

Fresco has done a good job of memory processing, with almost no problems with the previous 5.0 systems, but the problem will occur on some 5.0 models.

Solution:

1. Network pictures using more reasonable drawing rules

2. Change the picture to WEBP

3. Judging the exception of oom when image compression

Set Android:largeheap=true https://github.com/facebook/fresco/issues/768 in 4.manifest file

The 1.2.3 scheme optimizes memory or reduces oom anomalies, and the 4 scheme increases the heap size by 4-5 times larger than the normal allocation heap, which solves most of the current oom problems

"declaration"

Welcome reprint, but please keep the original source of the article

Blog Address: http://www.cnblogs.com/lping/

Article Source: http://www.cnblogs.com/lping/articles/5470716.html

Android Picture Memory issues

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.