Rewrite get_memory_info

Rewrite get_memory_info, thanks to scott.

Signed-off-by: Chuck Short <chuck.short@canonical.com>