Level three cache of pictures

Source: Internet
Author: User

Level three cache 1, first-level cache memory cache access fast, high efficiency, may cause memory overflow from the top down, the level is getting lower and stronger references, only when there is no reference to the virtual machine is recycled soft reference, when the memory is low, the virtual opportunity to automatically reclaim the soft reference reference of the object weak reference, when the As soon as the creation is complete, the virtual machine detects the memory continuously, when the weak reference is detected, the virtual reference is recovered and the VM is recycled at any time.




After Android 3.0, this is not recommended, it is recommended to use the LRUCache most recently used principle when memory is low, recycle objects that are infrequently used or are not used recently
2. Level two cache, local cache, cache to the files inside the Android, access slightly faster, save traffic
3. Level three cache, network cache

Implementation process: According to the URL to find a picture, how to find: 1. From the memory to find pictures, if found, directly show, if not found, from the local search, 2. Local cache to find, found on the show. Start accessing the network 3. Access the network to find Pictures 3.1 network find pictures, cache pictures to this Ground and memory 3.2 show pictures

1. Get the picture from memory newLRUCache



2. Get Pictures locally

How to store pictures locally


3. Get Pictures online   



From for notes (Wiz)

Level three cache of pictures

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.