Modular Computers the manual GitHub

free

free: display the amount of memory in use and free.

Synopsis

free [-b|-k|-m|-h]

Description

free prints the computer’s memory: the total (the RAM installed), what is in use, and what is free.

Before measuring it runs a full garbage collection 20 times, since Lua’s collector frees some objects (those with finalizers, for one) only on a later cycle; so used is what is really held, not garbage waiting to be collected.

Options

-b
Show amounts in bytes.
-k
Show amounts in KiB (the default).
-m
Show amounts in MiB.
-h
Show amounts in human-readable form, with a unit after each: B, Ki, Mi or Gi.

Each option is a separate argument; the last unit given wins, and -h wins over any unit.

Exit status

0 on success; 1 for an unknown option or if the memory could not be read.

Notes

There is no swap, so there is no Swap: line, and no buffer or cache columns. The total is the RAM installed above what the firmware itself holds.

See also

df(1), ps(1)