Cache Algorithms
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的更多相关文章
- Cache replacement policies 缓存实现算法
Cache replacement policies - Wikipedia https://en.wikipedia.org/wiki/Cache_replacement_policies Cach ...
- 浅析LRU(K-V)缓存
LRU(Least Recently Used)算法是缓存技术中的一种常见思想,顾名思义,最近最少使用,也就是说有两个维度来衡量,一个是时间(最近),一个频率(最少).如果需要按优先级来对缓存中的K- ...
- C++ Core Guidelines
C++ Core Guidelines September 9, 2015 Editors: Bjarne Stroustrup Herb Sutter This document is a very ...
- weblogic JDBC Connection Pools--转官方文档
http://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/jdbc_connection_pools.html#1106016 JDBC C ...
- MIT 6.S081 聊聊xv6中的文件系统(上)
前言 Lab一做一晚上,blog一写能写两天,比做Lab的时间还长( 这篇博文是半夜才写完的,本来打算写完后立刻发出来,但由于今天发现白天发博点击量会高点,就睡了一觉后才发(几十的点击量也是点击量啊T ...
- 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 ...
- rbd cache (一)
cache 1.why The existence of cache is based on a mismatch between the performance characteristics of ...
- Machine Learning Algorithms Study Notes(2)--Supervised Learning
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...
- [ZZ] Cache
http://blog.sina.com.cn/s/blog_6472c4cc0102duzr.html 处理器微架构访问Cache的方法与访问主存储器有类似之处.主存储器使用地址编码方式,微架构可以 ...
随机推荐
- SecureCRT结合xmanager远程启动图形化界面程序
我们很多操作都是可以通过命令行的形式来完成,但是由于不支持图形模式,在一些需要图形界面的时候就很麻烦.本次设置可以在secureCRT中直接使用netca\dbca命令,通过xmanager的pass ...
- 双机\RAC\Dataguard的区别
Oracle 双机/RAC/Dataguard的区别 Data Guard 是Oracle的远程复制技术,它有物理和逻辑之分,但是总的来说,它需要在异地有一套独立的系统,这是两套硬件配置可以不同的系统 ...
- Spring Boot 连接池
配置方法 基于当前的1.5.2.RELEASE的Spring Boot. 依照官方文档,如果增加了如下依赖的配置,或者类路径中存在spring-boot-starter-jdbc的jar,那么已默认启 ...
- Python的logging,记录log的包
最近在做自动化测试时,想给他加上日志,所以用到logging的模块,以下是python增加log的几种方式 一.python代码配置方式(当然还有一种是可以多模块通用的一个python代码设置,这个网 ...
- 运行 命令框不记录打过的命令,重启后CMD里面是空的.上次打过的命令消失了.
问题: 常要用到PING命令.在cmd中输入ping 202.103.44.150 /t (这是当地的电信DNS) 用这个查看网络是不是正常.正常情况下次点开始运行的时候,运行命令框中应该 会有上次打 ...
- 在c#中设置Excel格式
生成excel的时候有时候需要设置单元格的一些属性,可以参考一下: range.NumberFormatLocal = "@"; //设置单元格格式为文本 ange.get_Ran ...
- 转)Ubuntu安装mysql5.7
主要参考http://blog.csdn.net/q894523017/article/details/50705392 包去官网下载,解压,安装步骤如下: 上文中有错误,正确如下: sudo dpk ...
- MVC中构建Linq条件、排序、Selector字段过滤
代码: System.Linq.Expressions.Expression<Func<Domain.S_ROLE, bool>> expressWhere1 = (c =&g ...
- ==和equals方法:
Java程序中判断两个变量是否相等有两种方式: 一.利用 == 运算符: 1.1.如果两个变量是基本类型变量,且都是数值型(不一定要求数值类型完全相同),则只要两个变量的值相同,就返回true 1.2 ...
- python协程函数、递归、匿名函数与内置函数使用、模块与包
目录: 协程函数(yield生成器用法二) 面向过程编程 递归 匿名函数与内置函数的使用 模块 包 常用标准模块之re(正则表达式) 一.协程函数(yield生成器用法二) 1.生成器的语句形式 a. ...