新版的Linux中的free命令的输出解释_lantianjialiang的博客-CSDN博客_free/trail版本包括了已输出的


本站和网页 https://blog.csdn.net/lantianjialiang/article/details/78527295 的作者无关,不对其内容负责。快照谨为网络故障时之索引,不代表被搜索网站的即时页面。

新版的Linux中的free命令的输出解释_lantianjialiang的博客-CSDN博客_free/trail版本包括了已输出的
新版的Linux中的free命令的输出解释
lantianjialiang
于 2017-11-14 09:53:37 发布
6279
收藏
分类专栏:
C/C++/Linux
文章标签:
linux
内存
red hat
buffer
本文为博主原创文章,未经博主允许不得转载。
本文链接:https://blog.csdn.net/lantianjialiang/article/details/78527295
版权
C/C++/Linux
专栏收录该内容
174 篇文章
2 订阅
订阅专栏
free是用来查看当前系统的内存使用情况的。 在解释之前,先要熟悉几个概念。 共享链接库:它的意思是一些共享的库文件,不需要每个进程都加载到内存中,每个进程可以共享它们。从而达到节省内存的目的。比如libc.
然后是Cache Pages和Buffer,以下是从Redhat的网站上抓出来的。 这里需要注意一点的是:它们的系统来使用的,在新版本的free中是used列中,是没有计算出来的,原因就是在系统的可用内存没有的时候,OS会释放一些Cached或Buffered的内存,给应用程序。
Linux always tries to use RAM to speed up disk operations by using available memory for buffers (file system metadata) and cache (pages with actual contents of files or block devices). This helps the system to run faster because disk information is already in memory which saves I/O operations. If space is needed by programs or applications like Oracle, then Linux will free up the buffers and cache to yield memory for the applications. If your system runs for a while you will usually see a small number under the field “free” on the first line.
Cache Pages:
A cache is the part of the memory which transparently stores data so that future requests for that data can be served faster. This memory is utilized by the kernel to cache disk data and improve i/o performance.
The Linux kernel is built in such a way that it will use as much RAM as it can to cache information from your local and remote filesystems and disks. As the time passes over various reads and writes are performed on the system, kernel tries to keep data stored in the memory for the various processes which are running on the system or the data that of relevant processes which would be used in the near future. The cache is not reclaimed at the time when process get stop/exit, however when the other processes requires more memory then the free available memory, kernel will run heuristics to reclaim the memory by storing the cache data and allocating that memory to new process.
When any kind of file/data is requested then the kernel will look for a copy of the part of the file the user is acting on, and, if no such copy exists, it will allocate one new page of cache memory and fill it with the appropriate contents read out from the disk.
The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere in the disk. When some data is requested, the cache is first checked to see whether it contains that data. The data can be retrieved more quickly from the cache than from its source origin.
SysV shared memory segments are also accounted as a cache, though they do not represent any data on the disks. One can check the size of the shared memory segments using ipcs -m command and checking the bytes column.
Buffers :
Buffers are the disk block representation of the data that is stored under the page caches. Buffers contains the metadata of the files/data which resides under the page cache. Example: When there is a request of any data which is present in the page cache, first the kernel checks the data in the buffers which contain the metadata which points to the actual files/data contained in the page caches. Once from the metadata the actual block address of the file is known, it is picked up by the kernel for processing.
我们来看看free的输出:
-totalusedfreesharedbuff/cacheavailableMem:65697148289958041590953215873682079181232578364
total : 表示系统的总内存 used : 表示应用程序已经使用的内存 free : 表示当前还没有被使用的内存 shared :表示共享链接库使用的内存 buff/cache : 表示系统的page cache和buffer使用到的内存 available : 表示应用程序还可以申请到的内存
系统当前使用到的内存是:used + buff/cache,used中包含了shared。
所以total = used + buff/cache + free = 28995804 +20791812 + 15909532 = 65697148。
available(32578364) <= free + buff/cache(15909532 + 20791812 = 36701344),为什么是小于呢?因为系统的一些page或cache是不能回收的。
As of the new available field, for Linux kernels older than 2.6.27, its value is the same as the free value, but for the later versions of the Kernel, its a bit different:
Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)
refs: https://askubuntu.com/questions/770108/what-do-the-changes-in-free-output-from-14-04-to-16-04-mean
http://www.cnblogs.com/chenpingzhao/p/5161844.html
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/chap-Oracle_9i_and_10g_Tuning_Guide-Memory_Usage_and_Page_Cache.html
lantianjialiang
关注
关注
点赞
收藏
打赏
评论
新版的Linux中的free命令的输出解释
free是用来查看当前系统的内存使用情况的。 在解释之前,先要熟悉几个概念。 共享链接库:它的意思是一些共享的库文件,不需要每个进程都加载到内存中,每个进程可以共享它们。从而达到节省内存的目的。比如libc.然后是Cache Pages和Buffer,以下是从Redhat的网站上抓出来的。 这里需要注意一点的是:它们的系统来使用的,在新版本的free中是used列中,是没有计算出来的,原因就是
复制链接
扫一扫
专栏目录
free命令及显示的简易理解
timelvke的博客
10-13
1632
前言
free命令及显示的简易理解;
一、free命令
Linux free命令用于显示内存状态。
free指令会显示内存的使用情况,包括实体内存,虚拟的交换文件内存,共享内存区段,以及系统核心使用的缓冲区等。
语法
free [-bkmotV][-s <间隔秒数>]
参数说明:
-b  以Byte为单位显示内存使用情况。
-k  以KB为单位显示内存使用情况。
-m  以MB为单位显示内存使用情况。
-h  以合适的单位显示内存使用情况,最大为三位数,自动计.
Linux--基础语法(二)
最新发布
Xiayebuliang的博客
11-23
64
input :输入 output :输出。查看CPU : lscpu 和 cat/proc/cpuinfo。which :查找文件/目录所在路径位置 which is ls。find 路径 | grep 内容,文件名,目录。find /opt/ | grep 内容。lsblk :查看硬盘的分区情况。uname-r :查看内核版本。free :查看内存大小。date :系统时间。
评论 1
您还未登录,请先
登录
后发表或查看评论
linux中free命令查询的total used free shared buff/cache available各自代表的意思以及相关优化
Able
06-02
7808
total 总物理内存
used 已经使用的物理内存
free 没有使用过的物理内存
shared多进程共享内存
buff/cache 读写缓存内存,这部分内存是当空闲来用的,当free内存不足时,linux内核会将此内存释放
available还可以被应用程序使用的物理内存
若buff/cache过高而free过低,可用以下命令进行释放优化
echo 1 > /proc/sys/vm/drop_caches:表示清除pagecache。
echo 2 > /proc...
【云原生 | 从零开始学Kubernetes】二十五、kubectl深入理解
欢迎关注,一起进步!
10-02
917
kubectl 是操作 k8s 集群的命令行工具,安装在 k8s 的 master 节点,使用 kubectl 它会在 $HOME/.kube 目录中查找一个名为 config 的文件, 你可以通过设置 Kubeconfig 环境变量或设置特定的 kubeconfig,kubectl 也可以使用特定的 kubeconfig 文件操作 k8s 集群。kubectl 通过与 apiserver 交互可以实现对 k8s 集群中各种资源的增删改查。
free命令的正确读取方式
小小郭
03-27
3424
关于free命令的各参数网上有好多的资料,我们来看看正确的解读方式是怎样的。
现在linux上面的free命令有两个版本,比如centos 6 用的是旧版本,centos 7 用的是新版本,如下
centos 6 :
[root@centos-6-2 ~]# uname -r
2.6.32-573.22.1.el6.x86_64
[root@centos-6-2 ~]# free
...
free命令新旧两个版本的区别
紫眸的博客
08-30
1286
Linux新版本的free命令:
总物理内存 total=used+free+buff/cache
还可以申请的物理内存 = available
系统已使用的物理内存 = total - available
available &amp;lt;= free + buff/cache 因为系统的一部分page或cache是不能回收的
...
free -m命令输出详解
cuchengjiao8603的博客
12-28
3101
free -m输出有3行:
Mem:表示物理内存
-/+ buffers/cached:表示物理内存缓存
Swap:表示硬盘交换分区
其中Mem中的total、used、fr...
Linux的free命令输出详解
AndyTsui的专栏
02-14
756
<br />[root@Linux /tmp]# free<br /> total used free shared buffers cached<br />Mem: 255268 238332 16936 0 85540 126384<br />-/+ buffers/cache: 26408 228860 <br />Swap: 265000
linux free 命令输出中 buffer 与 cache 的区别,有这篇就够了
iqifenxia的博客
11-09
649
free 命令是Linux系统上查看内存使用状况最常用的工具,然而很少有人能说清楚 “buffers” 与 “cached” 之间的区别:
我们先抛出结论,如果你对研究过程感兴趣可以继续阅读后面的段落:
“buffers” 表示块设备(block device)所占用的缓存页,包括:直接读写块设备、以及文件系统元数据(metadata)比如SuperBlock所使用的缓存页;
“cached” 表示普通文件数据所占用的缓存页。
下面是分析过程:
先用 strace 跟踪 free 命令,看看
linux中free命令查询的total used free shared buff/cache available各自代表的意思以及相关优化
qq_32784303的博客
12-25
7974
total 总物理内存
used 已经使用的物理内存
free 没有使用过的物理内存
shared多进程共享内存
buff/cache 读写缓存内存,这部分内存是当空闲来用的,当free内存不足时,linux内核会将此内存释放
available还可以被应用程序使用的物理内存
若buff/cache过高而free过低,可用以下命令进行释放优化
echo 1 > /...
free命令详解(转载)
xupeng1644的博客
03-21
2452
命令
free 命令显示系统内存的使用情况,包括物理内存、交换内存(swap)和内核缓冲区内存。
如果加上 -h 选项,输出的结果会友好很多:
有时我们需要持续的观察内存的状况,此时可以使用 -s 选项并指定间隔的秒数:
$ free -h -s 3
上面的命令每隔 3 秒输出一次内存的使用情况,直到你按下 ctrl + c。
由于 free 命令本身比较简单,所以本文的重点会放在如何通过 free 命令了解系统当前的内存使用状况。
输出简介
下面先解释一下输出的内容:
Mem 行(第二行)是内存
每天一个linux命令(45):free 命令
hxshine的博客
01-11
522
free命令可以显示Linux系统中空闲的、已用的物理内存及swap内存,及被内核使用的buffer。在Linux系统监控的工具中,free命令是最经常使用的命令之一。1.命令格式:free [参数]2.命令功能:free 命令显示系统使用和空闲的内存情况,包括物理内存、交互区内存(swap)和内核缓冲区内存。共享内存将被忽略3.命令参数:-b  以Byte为单位显示内存使用情况。
-k  以KB
free -m命令输出的各项参数解释
weixin_34392843的博客
09-24
508
http://www.bkjia.com/Linuxjc/1233767.html
转载于:https://blog.51cto.com/yht1990/2283723
free命令详解
xungen的博客
06-08
5558
命令简介
linux下可以使用free命令看到系统实际使用内存的情况,一般用free -h命令查看内存占用情况。而系统实际可用内存是不是free部分呢,不是的,系统实际内存占用以及可用内存有如下几个加减法:
内存占用:used - buffers - cached
可用内存:buffers + cached + free
命令选项
-b:以Byte为单位显示内存使用情况
-k:以KB为单位显...
Linux free命令输出信息详解
weixin_34211761的博客
01-10
143
先看一下free命令的输出:[root@zfcg ~]# free -m
total used free shared buffers cached
Mem: 32101 15882 16219 0 459 13934
-/+ ...
Linux上的free命令详解
weixin_34054866的博客
02-20
541
  解释一下Linux上free命令的输出。
  下面是free的运行结果,一共有4行。为了方便说明,我加上了列号。这样可以把free的输出看成一个二维数组FO(Free Output)。例如:
FO[2][1] = 24677460
FO[3][2] =10321516
1 2 3...
free结果解释
weixin_30621919的博客
03-20
47
free用于查询内存使用情况,不过其多个数值经常让人感到迷惑,下边对其结果各值进行解释。
Mem
1862--总内存/1770--已使用内存/92--未使用内存/199--输出缓存/637--输入缓存
-/+
933--实际使用内存(1770-199-637)/929--实际可用内存(92+199+637)
Swap
3999--交换分区...
linux free 命令下free/available区别
热门推荐
gpcsy的博客
12-11
3万+
例子
[root@VM_16_17_centos bin]# free
total used free shared buff/cache available
Mem: 1882892 785272 280428 40496 817192 852060
S...
linux free 信息,Linux free命令输出信息详解
weixin_29698317的博客
05-07
220
先看一下free命令的输出:[root@zfcg ~]# free -mtotal used free shared buffers cachedMem: 32101 15882 16219 0 459 13934-/+ buffers/cache: 1488 ...
“相关推荐”对你有帮助么?
非常没帮助
没帮助
一般
有帮助
非常有帮助
提交
©️2022 CSDN
皮肤主题:大白
设计师:CSDN官方博客
返回首页
lantianjialiang
CSDN认证博客专家
CSDN认证企业博客
码龄15年
暂无认证
483
原创
2万+
周排名
1567
总排名
140万+
访问
等级
1万+
积分
135
粉丝
74
获赞
70
评论
215
收藏
私信
关注
热门文章
One Piece1-541(ed2k)
97614
使用sed输出文件的指定行
55972
小羊肖恩三季全(ed2k)
19784
maven中的${os.detected.classifier}变量从哪里来
15585
如何在excel中计算percentile和quartile
14558
分类专栏
Openstack
12篇
docker
1篇
ASP.NET
8篇
C/C++/Linux
174篇
Eclipse
56篇
Java
110篇
JS
24篇
Web
2篇
文化
6篇
杂项
75篇
计算机相关
194篇
奇思妙想/创意
11篇
游戏
1篇
下载(BT/ed2k)
9篇
IC(integrated circuit)
46篇
Python
25篇
Android
28篇
Thinking
1篇
PHP
21篇
git
ruby
7篇
LTspice
16篇
MongoDB
10篇
日语
13篇
English
1篇
Hadoop
4篇
Perl
4篇
最新评论
WGL中的Scan信息的解析
lantianjialiang:
这个要看你需要转的二进制的格式是什么;每个ATE厂家的都不一样的,都有自己的格式
stdf的default data
evvvvan:
感谢分享。这几年国内外的各种STDF分析软件也越来越多了,商业小软件的功能强大,但是费用也非常高,像QuickEdit, STDFme, STDFTool, NEDA, 寰友等普遍都在5000RMB ~ 20000RMB一年左右。当然像Galaxy, YieldWerx, OptimalTest, PDF, Tango, RTM,WebSemi等大型系统的费用就更加昂贵了,都是十几万到几十万每年。微软应用商店出现了一款STDF Statistical Analyzer做得还不错
WGL中的Scan信息的解析
着陆前检查单:
就是wgl格式文件如何转换成二进制文件
WGL中的Scan信息的解析
lantianjialiang:
具体问题是什么?
WGL中的Scan信息的解析
着陆前检查单:
大哥你好,小弟有个问题想请教一下,关于飞机上传回wgl文件的译码问题。
您愿意向朋友推荐“博客详情页”吗?
强烈不推荐
不推荐
一般般
推荐
强烈推荐
提交
最新文章
Windows系统解压zip文件之后乱码的问题的原因和解决方法
Linux中的五种网络API的模型的解释
如何预估项目
2022年7篇
2021年30篇
2020年34篇
2019年36篇
2018年36篇
2017年61篇
2016年60篇
2015年41篇
2014年96篇
2013年116篇
2012年94篇
2011年54篇
2010年55篇
2009年42篇
2008年34篇
目录
目录
分类专栏
Openstack
12篇
docker
1篇
ASP.NET
8篇
C/C++/Linux
174篇
Eclipse
56篇
Java
110篇
JS
24篇
Web
2篇
文化
6篇
杂项
75篇
计算机相关
194篇
奇思妙想/创意
11篇
游戏
1篇
下载(BT/ed2k)
9篇
IC(integrated circuit)
46篇
Python
25篇
Android
28篇
Thinking
1篇
PHP
21篇
git
ruby
7篇
LTspice
16篇
MongoDB
10篇
日语
13篇
English
1篇
Hadoop
4篇
Perl
4篇
目录
评论 1
被折叠的 条评论
为什么被折叠?
到【灌水乐园】发言
查看更多评论
打赏作者
lantianjialiang
你的鼓励将是我创作的最大动力
¥2
¥4
¥6
¥10
¥20
输入1-500的整数
余额支付
(余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付
您的余额不足,请更换扫码支付或充值
打赏作者
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额
抵扣说明:
1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。
余额充值