free的命令详解

  • A+
所属分类:运维教程

free命令可以显示当前系统未使用的和已使用的内存数目,还可以显示被内核使用的内存缓冲区。

语法

free [选项]

选项

[table id=9 /]

注意:Red Hat Enterprice Linux 6.7加入-h用于使用习惯单位显示。

效果

free的命令详解

第一行的解释

[table id=10 /]

关系是total=used+free。

第二行的解释

-buffers/cache是指used的内存数:第一部分Mem行中的used-buffers-cached;

+buffers/cache是指free的内存数:第一部分Mem行中的free+buffers+cached。

可见-buffers/cache反映的是被程序实实在在吃掉的内存数,而+buffers/cache反映的是可以挪用的内存数。

第三行的解释

交换分区总数,已经使用,空余空间。

清空缓存

  1. echo 3>/proc/sys/vm/drop_caches
  • 问答中心
  • 微信小程序扫一扫
  • weinxin
  • 微信公众
  • 微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:35   其中:访客  35   博主  0

    • avatar Immobilienbewertung Limbach-Oberfrohna

      Some genuinely superb information, Glad I found this. “Men in no way approach so nearly to the gods as in doing good to men.” by Marcus Tullius Cicero.

      • avatar financial accounting,

        I love reading an article that will make men and women think. Also, thanks for allowing for me to comment!

        • avatar techno songs

          Howdy! This article could not be written any better! Looking at this article reminds me of my previous roommate! He always kept talking about this. I will send this information to him. Pretty sure he’s going to have a great read. Thank you for sharing!

          • avatar grolyrtolemcs

            Hiya, I’m really glad I’ve found this information. Today bloggers publish just about gossips and web and this is actually irritating. A good web site with interesting content, this is what I need. Thank you for keeping this web site, I will be visiting it. Do you do newsletters? Can not find it.

            • avatar 12 minute affiliate review

              I blog often and I seriously appreciate your content. This great article has truly peaked my interest. I will bookmark your site and keep checking for new information about once a week. I opted in for your RSS feed as well.