Shell commands to find available memory

Richard Gaskin ambassador at
Tue Aug 14 13:55:18 EDT 2012

Finding available memory on Linux is easy using the shell command "free".

But "free" isn't available on OS X, and although "alloc" is listed as an 
equivalent at some sites it isn't available on any of the Macs I have here.

I could use "top -l1 -n0" to get just the overview stuff from which I 
can parse out the memory info, but it's not a very fast command to 
execute, taking more than a second to return the result to LiveCode.

On Windows there's the "mem" command, but that only returns memory 
available for the CLI itself, not for the whole system.

Anyone here know a fast way to get available memory on OS X and Windows 
on all versions of those OSes supported by LiveCode?


  Richard Gaskin
  Fourth World
  LiveCode training and consulting:
  Webzine for LiveCode developers:
  Follow me on Twitter:

More information about the use-livecode mailing list