一、明确概念

    • 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

参考

spring-cache

java.nio.buffer

美团:磁盘I/O那些事

Linux上free命令的输出及其他的更多相关文章

  1. Linux上free命令的输出

    一.明确概念 A buffer is something that has yet to be "written" to disk.  A cache is something t ...

  2. 如何在屏幕上查看命令的输出以及在Linux中写入文件

    在Linux中输出命令可以做很多事情(http://www.nanke0834.com) 您可以将命令的输出分配给变量,将其发送到另一个命令/程序以通过管道进行处理或将其重定向到文件以进行进一步分析. ...

  3. [转帖]如何在Linux上使用命令行查看硬件信息

    如何在Linux上使用命令行查看硬件信息 时间:2016-01-13   作者:admin 分类:新手入门 阅读:126次 http://embeddedlinux.org.cn/emb-linux/ ...

  4. LINUX上一个命令计算PI

    Linux上一个命令计算PI – 笑遍世界 http://smilejay.com/2017/11/calculate-pi-with-linux-command/ [root@d1 goEcho]# ...

  5. [编译] 7、在Linux下搭建安卓APP的开发烧写环境(makefile版-gradle版)—— 在Linux上用命令行+VIM开发安卓APP

    April 18, 2020 6:54 AM - BEAUTIFULZZZZ 目录 0 前言 1 gradle 安装配置 1.1 卸载系统默认装的gradle 1.2 下载对应版本的二进制文件 1.3 ...

  6. Linux上常用命令整理(一)—— cat

    近几个月刚从windows上转过来,开始慢慢熟悉linux,先不撕比到底哪个更好,首先要怀着相互借鉴的精神去了解各个平台. Linux上做开发,除去使用文本编辑器做开发的大神之外,大家(包括我这种菜鸟 ...

  7. 【Linux】将一个命令的输出发送给另外一个命令

    一个命令的输出可以作为下一个命令的输入,下一个命令的输出又会传递给下一个命令 我们通常使用管道和子shell的方法来组合多个命令的输出 格式 $ cmd1 |cmd2 | cmd3 这里的3个组合命令 ...

  8. Linux上常用命令整理(二)—— paste

    上一篇整理了cat指令的几个基本常见用法,这次整理一下paste指令的基本用法. cat paste cut grep paste paste可以简单的理解为把两个文件的内容按列合并,与cat命令直接 ...

  9. hadoop,spark,linux上常用命令

    记下常用命令,慢慢补充 1.hadoop 查看hdfs上的目录: hadoop fs -ls /给hdfs上目录授予权限:   hadoop fs -chmod 777 /tmp/hive 在hdfs ...

随机推荐

  1. 如何使用Photoshop(PS)将图片的底色变为透明

    很多时候需要将一张图片的底色变得透明.本文描述了使用PS将图片的一部分变得透明的方法.本例将一段艺术字的背景去掉,将背景透明的文字单独保存成图片,这样以后将这段文字粘贴到其他素材上的时候,就不用担心它 ...

  2. java调用c#开发的webservice

    使用jdk自带的wsimport工具生成代理类 c:\Program Files\Java\jdk1..0_121\bin>wsimport -keep -encoding utf- -d d: ...

  3. 元器件封装标准IPC-7351

    IPC-7351依赖久经考验的数学算法,综合考虑制造.组装和元件容差,从而精确计算焊盘图形.该标准以IPC-SM-782研发概念为基础进一步提高,对每一个元件都建立了三个焊盘图形几何形状,对每一系列元 ...

  4. Ubuntu Apache配置及开启mod_rewrite模块

    刚刚将服务器系统从CentOS换成Ubuntu,将MySQL,Apache,PHP和Wordpress安装好后,发现打开主页是正常的,但是打开文章页面时出现错误.因为使用了自定义的固定链接设置,那自然 ...

  5. wget命令 -c断点续传

    wget -O   wordpress.zip http://www.linuxde.net/download.aspx?id=1080 下载文件在指定位置并进行重命名 -O file       - ...

  6. Control character in cookie value or attribute

    在cookie中添加中文导致静态页面打不开, (1)先清除缓存 (2)使用escape()函数对中文进行编码,获取的时候在对中文进行解码unescape(). cookie.Set("sto ...

  7. 自定义select模拟--基于jQuery

      说明 模拟select,实现原生select不能实现的样式 将html结构入在Html页面中,css,js做分离 开发人员引用只要引入相关文件,并$().selectbox()就可转换样式,有更新 ...

  8. 【BZOJ】2015: [Usaco2010 Feb]Chocolate Giving(spfa)

    http://www.lydsy.com/JudgeOnline/problem.php?id=2015 这种水题真没啥好说的.. #include <cstdio> #include & ...

  9. C语言中文网

    网址:http://c.biancheng.net/cpp/ 涵盖如下:

  10. ChemDraw Pro和ChemBio3D Ultra有什么区别

    作为ChemOffice 14的两个重要组件,ChemDraw Pro和ChemBio3D Ultra都有着自己的特点,ChemDraw Pro以绘制平面结构而ChemBio3D Ultra以绘制立体 ...