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. Nagios自定义扩展

    原理:监控端通过check_nrpe把要监控的指令发送给被监控端,被监控端在本机执行监控任务,并把执行的结果发送回监控端. 如何扩展Nagios,以实现自定义监控? 借助插件进行的每一次有效的Nagi ...

  2. Life is in the little things --- Spreading wildly on Facebook

    这是在FaceBook上疯传的一组图 简笔画的图画的不算精细 但却狠狠地击中许多人的心灵   有时候生活中简单的一件小事, 恰恰是使得你的人生变得更有意义的一件大事! 别人总告诉你 人生是这样的 ▼ ...

  3. ArcGIS案例学习笔记2_1

    ArcGIS案例学习笔记2_1 联系方式:谢老师,135_4855_4328,xiexiaokui#qq.com 时间:第二天上午 案例1:学校选址 内容:栅格数据分析 教程:pdf page=323 ...

  4. spring ioc xml配置

    一个完整的spring xml配置:是把action,service,dao以及其它的资源性配置(如basedao)和公共性配置(如连接数据库)配置在resource.xml中,这样就有四个xml配置 ...

  5. hibernate事务隔离机制

    事务的基本概念 ACID:A是atomicity(原子性),C是consistency(一致性),I是isolation(隔离性),D是durability(持久性) 事务隔离级别从低到高: 读取未提 ...

  6. Containerpilot 配置文件模板

    { "consul": "{{ .CONSUL }}:8500", "logging": { "level": &quo ...

  7. oracle,PL/SQL新建表

    创建用户 -- Create the user create user U_HQ_JAVA default tablespace USERS temporary tablespace TEMP pro ...

  8. 【校招面试 之 剑指offer】第11题 旋转数组中的最小数字

    题目:把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转.输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素.例如: 数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转, ...

  9. jquery 动态添加的代码不能触发绑定事件

    今天发现jQuery对动态添加的元素不触发事件,比如blur.click事件等 参考文章证明了我的结论,并给出了原因及解决方案 原因:程序找不到动态添加的节点. 解决方案:在绑定父元素后的子元素 $( ...

  10. php单点登陆简单实现 (iframe方式)

    有四个网站分别为: www.a.com www.b.com www.c.com www.sso.com 需求是如果我们在sso登陆后,其他网站也会显示登陆中,不需要重复登陆,退出时,其他网站也会失效. ...