Read /proc/meminfo, pull out some numbers and use them.
# Linux with DEBUG: CFLAGS=-DDEBUG make -f Makefile.linux # BSD: make