zoukankan      html  css  js  c++  java
  • free

    命令介绍

    在linux系统中一般用free命令查看和监控系统内存使用情况

    命令格式

    usage: free [-b|-k|-m|-g|-h] [-l] [-o] [-t] [-s delay] [-c count] [-V]
    -b,-k,-m,-g show output in bytes, KB, MB, or GB
    -h human readable output (automatic unit scaling)
    -l show detailed low and high memory statistics
    -o use old format (no -/+buffers/cache line)
    -t display total for RAM + swap
    -s update every [delay] seconds
    -c update [count] times
    -a show available memory if exported by kernel (>80 characters per line)
    -V display version information and exit

    常用操作

    free //以KB为单位,显示系统内存使用情况

    free -ml -s 1 //以M为单位,显示系统内存的详细使用情况

    free -s 2 -c 4 //以KB为单位,每2秒显示系统内存使用情况,一共执行了4次

    命令描述

    Mem:物理内存统计

    total:物理内存总量(total = used + free)

    used:已使用的物理内存(包含buffers与cache)

    free:空闲物理内存

    shared:共享内存

    buffers:系统分配的buffers数量

    cached:系统分配的cached数量

    -/+ buffers/cache:表示物理内存的缓存统计

    used、buffers、cached为第一行

    used2、free2为第二行

    used2:used2 = used - buffers - cached实际使用的内存总量

    free2:free2 = free + buffers + cached当前系统实际可用内存

    buffers与cached的区别

    buffer实施值用来给快设备做的缓存大小,它只记录文件系统的metadat以及tracking in-flight pages,比如目录里有什么内容和权限等等

    cached是用来给文件做缓冲的,直接记忆我们打开文件

  • 相关阅读:
    idea搭建Spring Boot+Mybatis及使用教程
    CentOS 6 安装配置JDK+tomcat环境
    关于无线路由器之间的连接
    关于链表的面试问题(判断一个单链表中是否有环)
    华为机试ACM(字符组合问题)
    Activity的启动模式
    Notification状态栏显示信息
    Java注释Override、Deprecated、SuppressWarnings
    Fragment
    Service
  • 原文地址:https://www.cnblogs.com/yangyangchunchun/p/7693377.html
Copyright © 2011-2022 走看看