Linux上free命令的输出及其他
一、明确概念
- A buffer is something that has yet to be "written" to disk.
- A cache is something that has been "read" from the disk and stored for later use.
也就是说buffer是用于存放要输出到disk(块设备)的数据的,而cache是存放从disk上读出的数据。
从应用场景上看:Buffer
更多的(场景)是减小写操作的冲击,而 Cache
主要用于减小读 I/O 的重复开销。
The terms "buffer" and "cache" tend to be used interchangeably, note however they represent different things.
(1)A buffer is used traditionally as an intermediate temporary store for data between a fast and a slow entity.
As one party would have to wait for the other affecting performance, the buffer alleviates this by allowing entire
blocks of data to move at once rather then in small chunks. The data is written and read only once from the buffer.
Furthermore, the buffers are visible to at least one party which is aware of it.
(2)A cache on the other hand by definition is hidden and neither party is aware that caching occurs. It as well
improves performance but does that by allowing the same data to be read multiple times in a fast fashion.
A further explanation of the differences between two can be found here.
二、命令输出
total used free shared buffers cached
Mem: 498 154 343 0 23 65
-/+ buffers/cache: 65 433
Swap: 1023 0 1023
Men:total = Men:used + Men:free
已使用 -buffers/cache = Mem:used - Men:buffers - Men:cached = 154-23-65 = 154-88 = 66 (1024byte = 1M )
还剩余 +buffers/cache = Men:free + Men:buffers + Men:cached = 343+23+65 = 343+88 = 431
参考
美团:磁盘I/O那些事
最新文章
- 在Redhat上为.Net 项目构建基于Jenkins + Github + Mono 的持续集成环境
- 安装centos时候自动安装vm tool,导致无法继续安装centos的解决办法
- Eclipse里面代码上下文变量点击后不一起变色
- httpclient提交json参数
- Centos部署nagios+apache实现服务器监控
- bzoj1976
- C++: Command Line Processing
- [重磅] 让HTML5达到原生的体验 系列之中的一个 避免切页白屏
- BaseFragment的定义—所有Fragment的父类
- 基础算法-查找:线性索引查找(II)
- [HAOI2006]受欢迎的牛
- JDBC数据库操作
- 浏览器渲染原理笔记 --《How Browser Work》读后总结
- [MySQL] mysql的事务隔离和幻读和死锁问题
- Oracle 项目中 SQL 脚本更新方式
- HTML文件默认内容
- all any some
- 【AOP】spring 的AOP编程报错:[Xlint:invalidAbsoluteTypeName]error
- mysql数据库,如何进行数据目录的初始化操作
- Java高级架构师(一)第41节:Nginx的配置优化以及使用建议