Skip to content

内存使用计算公式能否调整成usedMem = ((MemTotal) - (MemAvailable)) #135

@jekelo

Description

@jekelo

在高版本内核中 /proc/meminfo 新增字段 MemAvailable

该字段有考虑了内存水平位,比较合理

建议使用该字段来计算内存使用

MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773

目前 htop 已经调整,相关资料链接如下:

htop-dev/htop#281

https://github.com/GuillaumeGomez/sysinfo/pull/869/files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions