jrgp/linfo

OS X memory is reported in Mebibytes

dbwiddis opened this issue · 3 comments

Memory values in OS X are in Mebibytes.

Megabytes are only used for hard drives.

When calculating swap usage in Darwin.php you're multiplying the returned value by 1 million (Megabyte) rather than the correct 10242 (<< 20).

            $return['swapTotal'] = $swap_total * 1000000;
            $return['swapFree'] = $swap_free * 1000000;
jrgp commented

Thanks for the report. Are you able to make a PR with a fix?

jrgp commented

Thanks!

My pleasure.

I maintain a java-based library providing similar information to yours. I'll probably visit often to research new ideas. :)