Skip to content

The CPU calculation returns the wrong number when the free memory on the machine is over 1000M #1

@joeblau

Description

@joeblau

In memScale.sh the line
top -l 1 | awk '/Phys/{gsub(/[a-zA-Z]/,""); printf "%.0f", ($10/($8+$10))*100}'
Returns
PhysMem: 2410M wired, 2986M active, 190M inactive, 5586M used, 11G free.

And the script parses that 11G free incorrectly resulting in this scale

100%
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
mem

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