OS X's "free" or "/proc/meminfo" equivalent 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.
The closest analogs to free and cat /proc/meminfo might be vm_stat and ls -l /var/vm but you also have the BSD tools like heap and Darwin tool allmemory to dig deeper into processes and libraries to determine how the overall virtual memory load is allocated to specific processes.