A long time did not write a new blog, the reasons for a lot of good-sounding reason is work busy, busy life, all kinds of tired, straightforward point is actually become lazy, so did not write.
In the quiet for such a long period of time, finally again to start again, for their current state, feel the first to have a precipitate, then is to empty themselves, only to empty their side can continue to progress.
Later a period of time updated blog content body is related to the Android framework of the problem analysis, mechanism implementation principle, source code call analysis, and then accompanied by some common small algorithms, language characteristics, program principles.
Today, we first introduce LRU and LFU, both in the Android framework and the application of the most commonly used cache algorithm idea principle, in fact, the principle of these caching algorithms and Linux virtual memory page replacement algorithm idea is consistent, but the specific difference.
lfu (least frequently used ) : using the least frequency algorithm, Ideas and principles are If a data is rarely used in the most recent period of time, the likelihood of being used in the future is also very small, and The purpose of this algorithm is straightforward to understand that when the cached content needs to be updated and is already full, Quickly find and replace content that is used as often as the lowest number of times in the current entire cache.
LRU (least recently used): Most recent unused algorithm, The idea and principle is If a data is in the last is not accessed, the likelihood of its being accessed in the future is also very small, and the purpose of is straightforward to understand that when the cache content needs to be updated and is already full, quickly find and replace content that is not used until the longest time in the current entire cache.
Reference Links:
Http://www.cnblogs.com/dolphin0520/p/3749259.html
Http://www.cnblogs.com/dolphin0520/p/3741519.html
Http://blog.sina.com.cn/s/blog_631d3a630101mhup.html
http://qyappchentao.sinaapp.com/linux-mem-al/
Http://blog.sina.com.cn/s/blog_50197c290101ft7a.html
http://blog.csdn.net/summerhust/article/details/6867171
Special Days (May 1, 2015 Labor Day) commemorate the return and the new journey, using the LRU and LFU two small algorithm principles and differences to stimulate