AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 413593
Accepted
Hafiz Muhammad Shafiq
Hafiz Muhammad Shafiq
Asked: 2017-12-29 21:06:20 +0800 CST2017-12-29 21:06:20 +0800 CST 2017-12-29 21:06:20 +0800 CST

总内存和空闲内存有什么区别

  • 772

我有一个安装了 Centos 7 的桌面系统。它有 4 核和 12 GB 内存。为了查找内存信息,我使用free -h命令。我有一个困惑。

[user@xyz-hi ~]$ free -h
              total        used        free      shared  buff/cache   available
Mem:            11G        4.6G        231M         94M        6.8G        6.6G
Swap:          3.9G        104M        3.8G

在总列中,总容量为 11GB(正确),在可用的最后一列中,表示 6.6GB 和使用的是 4.6G。

如果已用内存为 4.6GB,则剩余应为 6.4 GB (11-4.6=6.4)。以上输出的正确解释是什么?总内存、可用内存和空闲内存有什么区别?如果某些新应用程序需要 1 GB 以上的内存,我是否内存不足?

linux memory
  • 1 1 个回答
  • 25322 Views

1 个回答

  • Voted
  1. Best Answer
    Hafiz Muhammad Shafiq
    2017-12-30T02:41:06+08:002017-12-30T02:41:06+08:00

    man free命令解决了我的问题。

    DESCRIPTION
           free  displays the total amount of free and used physical and swap mem‐
           ory in the system, as well as the buffers and caches used by  the  ker‐
           nel.  The  information  is  gathered by parsing /proc/meminfo. The dis‐
           played columns are:
    
           total  Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
    
           used   Used memory (calculated as total - free - buffers - cache)
    
           free   Unused memory (MemFree and SwapFree in /proc/meminfo)
    
           shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available
                  on kernels 2.6.32, displayed as zero if not available)
    
           buffers
                  Memory used by kernel buffers (Buffers in /proc/meminfo)
    
           cache  Memory  used  by  the  page  cache and slabs (Cached and Slab in
                  /proc/meminfo)
    
           buff/cache
                  Sum of buffers and cache
    
           available
                  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, avail‐
                  able on kernels 3.14, emulated on kernels 2.6.27+, otherwise the
                  same as free)
    
    • 17

相关问题

  • 使用键盘快捷键启动/停止 systemd 服务 [关闭]

  • 需要一些系统调用

  • 进程是否可以分配高速缓存,以便内核在必要时可以占用它?

  • astyle 不会更改源文件格式

  • 通过标签将根文件系统传递给linux内核

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    JSON数组使用jq来bash变量

    • 4 个回答
  • Marko Smith

    日期可以为 GMT 时区格式化当前时间吗?[复制]

    • 2 个回答
  • Marko Smith

    bash + 通过 bash 脚本从文件中读取变量和值

    • 4 个回答
  • Marko Smith

    如何复制目录并在同一命令中重命名它?

    • 4 个回答
  • Marko Smith

    ssh 连接。X11 连接因身份验证错误而被拒绝

    • 3 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Marko Smith

    systemctl 命令在 RHEL 6 中不起作用

    • 3 个回答
  • Marko Smith

    rsync 端口 22 和 873 使用

    • 2 个回答
  • Marko Smith

    以 100% 的利用率捕捉 /dev/loop -- 没有可用空间

    • 1 个回答
  • Marko Smith

    jq 打印子对象中所有的键和值

    • 2 个回答
  • Martin Hope
    EHerman JSON数组使用jq来bash变量 2017-12-31 14:50:58 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Drux 日期可以为 GMT 时区格式化当前时间吗?[复制] 2017-12-26 11:35:07 +0800 CST
  • Martin Hope
    AllisonC 如何复制目录并在同一命令中重命名它? 2017-12-22 05:28:06 +0800 CST
  • Martin Hope
    Steve “root”用户的文件权限如何工作? 2017-12-22 02:46:01 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST
  • Martin Hope
    Cbhihe 将默认编辑器更改为 vim for _ sudo systemctl edit [unit-file] _ 2017-12-03 10:11:38 +0800 CST
  • Martin Hope
    showkey 如何下载软件包而不是使用 apt-get 命令安装它? 2017-12-03 02:15:02 +0800 CST
  • Martin Hope
    youxiao 为什么目录 /home、/usr、/var 等都具有相同的 inode 编号 (2)? 2017-12-02 05:33:41 +0800 CST
  • Martin Hope
    user223600 gpg —list-keys 命令在将私钥导入全新安装后输出 uid [未知] 2017-11-26 18:26:02 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve