The difference between LRU and LFU

Source: Internet
Author: User
Tags mongodb postgresql redis firewall

LRU and LFU are different!

LRU is the least recently used page replacement algorithm (Least recently used), which is the first time to eliminate the longest unused pages!

LFU is the most infrequently used page replacement algorithm (Least frequently used), which is the least visited page in a certain period of time!

For example, the second method of the time t is 10 minutes, if the paging per minute, the main memory block is 3, if the desired page trend is 2 1 2 1 2 3 4

Note that a page break will occur when paging 4 o'clock

If the LRU algorithm, should be changed page 1 (1 pages have not been used) but according to the LFU algorithm should be changed Page 3 (10 minutes, Page 3 is used only once)

It is visible that the LRU key is to see the last time the page was used to schedule the duration of the event,

The key to Lfu is to see how often the page is used within a certain time period!

Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

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.