OS X lacks the "Linux-friendly" free
or /proc/meminfo
.
What would be the most reliable and backwards-compatible way of extracting this info:
- Current free memory, in bytes
Going back as far as possible in terms of OS versions, without requiring extensions like ports
, brew
, etc.
Best Answer
The closest analogs to
free
andcat /proc/meminfo
might bevm_stat
andls -l /var/vm
but you also have the BSD tools like heap and Darwin toolallmemory
to dig deeper into processes and libraries to determine how the overall virtual memory load is allocated to specific processes.