How to check how free RAM is available?

You can use your system routines.
If you are at unix-like:

run(`egrep --color 'Mem|Cache|Swap' /proc/meminfo`)
3 Likes