You can use your system routines. If you are at unix-like:
run(`egrep --color 'Mem|Cache|Swap' /proc/meminfo`)