1. 平均内存引用时间

T = average memory reference time

m = miss ratio = 1 - (hit ratio)

Tm = time to make a main memory access when there is a miss (or, with multi-level cache, average memory reference time for the next-lower cache)

Th =  the latency: the time to reference the cache when there is a hit

E = various secondary effects, such as queuing effects in multiprocessor systems

平均内存引用时间 = 丢失率 * 丢失时加入时间 + 命中时引用时间(延迟) + 多种次要影响(比如多级处理器排队等待时间)

参考 https://en.wikipedia.org/wiki/Cache_algorithms

2. 替换算法

关键词:research 、 traditional 、 大内存 、 遍历周期

OPT (The theoretically optimal page replacement algorithm)

This algorithm cannot be implemented in a general purpose operating system because it is impossible to compute reliably how long it will be before a page is going to be used, except when all software that will run on a system is either known beforehand and is amenable to static analysis of its memory reference patterns, or only a class of applications allowing run-time analysis.

无法实现

NRU (Not recently used)

It is an algorithm that favours keeping pages in memory that have been recently used.

3. referenced, modified
2. referenced, not modified
1. not referenced, modified
0. not referenced, not modified

从最低级(0级)选择随机页删除

FIFO (First-in, first-out)

最简单的页替换算法,可用List和LinkedHashMap 实现

LRU (The least recently used)

LRU works on the idea that pages that have been most heavily used in the past few instructions are most likely to be used heavily in the next few instructions too.

在前面几条指令中使用频繁的页面很可能在后面的几条指令中频繁使用。

反过来说,已经很久没有使用的页面很可能在未来较长的一段时间内不会被用到。

Random

Random replacement algorithm replaces a random page in memory.

NFU (Not frequently used)

The not frequently used (NFU) page replacement algorithm requires a counter, and every page has one counter of its own which is initially set to 0.

Cache Algorithms的更多相关文章

  1. Cache replacement policies 缓存实现算法

    Cache replacement policies - Wikipedia https://en.wikipedia.org/wiki/Cache_replacement_policies Cach ...

  2. 浅析LRU(K-V)缓存

    LRU(Least Recently Used)算法是缓存技术中的一种常见思想,顾名思义,最近最少使用,也就是说有两个维度来衡量,一个是时间(最近),一个频率(最少).如果需要按优先级来对缓存中的K- ...

  3. C++ Core Guidelines

    C++ Core Guidelines September 9, 2015 Editors: Bjarne Stroustrup Herb Sutter This document is a very ...

  4. weblogic JDBC Connection Pools--转官方文档

    http://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/jdbc_connection_pools.html#1106016 JDBC C ...

  5. MIT 6.S081 聊聊xv6中的文件系统(上)

    前言 Lab一做一晚上,blog一写能写两天,比做Lab的时间还长( 这篇博文是半夜才写完的,本来打算写完后立刻发出来,但由于今天发现白天发博点击量会高点,就睡了一觉后才发(几十的点击量也是点击量啊T ...

  6. Ehcache(2.9.x) - API Developer Guide, Cache Eviction Algorithms

    About Cache Eviction Algorithms A cache eviction algorithm is a way of deciding which element to evi ...

  7. rbd cache (一)

    cache 1.why The existence of cache is based on a mismatch between the performance characteristics of ...

  8. Machine Learning Algorithms Study Notes(2)--Supervised Learning

    Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...

  9. [ZZ] Cache

    http://blog.sina.com.cn/s/blog_6472c4cc0102duzr.html 处理器微架构访问Cache的方法与访问主存储器有类似之处.主存储器使用地址编码方式,微架构可以 ...

随机推荐

  1. setTranslatesAutoresizingMaskIntoConstraints

    [viewItem setTranslatesAutoresizingMaskIntoConstraints:NO]; 在给继承UIView的类设置此属性后,UIView的某些属性可能发生变化.例如f ...

  2. Mysql count(1) group_concat 高级用法(count 过滤条件,group_concat过滤条件)

    1.官方文档: count:COUNT(expr) [over_clause] https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.h ...

  3. Centos7 配置ssh 免秘钥登陆

    1.yum install -y openssh 2.servier1: ssh-keygen -t rsa #有提示的直接enter 3.server 2: ssh-keygen -t rsa # ...

  4. IPMS 元件实作

    一.改用zg框架的jsp 1.引入表头和表尾jsp <%@ include file="../../jsp/menuHeader.jsp"%> <%@ inclu ...

  5. java基础四 [构造器和垃圾回收](阅读Head First Java记录)

    本章讲解了对象的创建到被回收的过程,讲述了对象的生命周期   堆(heap)与栈(stack) 实例变量:实例变量是只声明在类下,方法外的变量(实例变量默认值为0/0.0/false,引用的默认值为n ...

  6. 7.Reverse Integer (INT; Overflow)

    Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 思路:要注意溢出 ...

  7. 最近公共祖先 · Lowest Common Ancestor

    [抄题]: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. “Th ...

  8. 删除链表中的重复元素:不留&留一个&删除一个

    不留: [抄题]: 给定一个排序链表,删除所有重复的元素只留下原链表中没有重复的元素. [思维问题]: 给出 1->2->3->3->4->4->5->nul ...

  9. (转)innodb 多版本并发控制原理详解

    转自:https://blog.csdn.net/aoxida/article/details/50689619 多版本并发控制技术已经被广泛运用于各大数据库系统中,如Oracle,MS SQL Se ...

  10. yaf框架安装配置

    YAF中文文档:http://www.laruence.com/manual/index.html 1 YAF框架是用C开发的,属于PHP的扩展框架: 2 YAF的性能相对于源生PHP,性能只降低不到 ...