Skip to content

Linux memory is calculated using Available memory instead of Used memory #1

@dmacbale-cas

Description

@dmacbale-cas

Going to run some commands inside of a container to demonstrate the issue here. I'm also going to use free -m instead of free -b because it's easier to see differences.

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           7951         578        4292         333        3080        6919
Swap:          1024           0        1024

{print $2} should match total:

$ free -m | grep "Mem:" | awk '{print $2}'
7951

Looks good!

{print $7} should match used:

$ free -m | grep "Mem:" | awk '{print $7}'
6919

It matches available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions