32

动手实现一个 LRU cache | crossoverJie's Blog

 6 years ago
source link: https://crossoverjie.top/2018/04/07/algorithm/LRU-cache/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言LRU 是 Least Recently Used 的简写,字面意思则是最近最少使用。通常用于缓存的淘汰策略实现,由于缓存的内存非常宝贵,所以需要根据某种规则来剔除数据保证内存不被撑满。如常用的 Redis 就有以下几种策略:策略描述volatile-lru从已设置过期时间的数据集中挑选最近最少使用的数据淘汰volatile-ttl从已设置过期时间的数据集中

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK