You'll have to decide whether you want to include swap usage in it or not.
In linux, parse /proc/meminfo. In other unix systems, you might try to parse the output of free, or top bn1 if free doesn't work for some reason. (Update: it seems that free doesn't exist on solaris. top does work, but its arguments are different from the linux version.)
In reply to Re: current RAM availability
by ambrus
in thread current RAM availability
by bubulik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |