def memory_total_size():
    """
    Get the total amount of memory from /proc/meminfo.
    """
    try:
        with open('/proc/meminfo', 'r') as fd:
            for line in fd.readlines():
                items = line.split()
                if len(items) > 0:
                    if items[0][:-1] == 'MemTotal':
                        mem_total = int(items[1])
                        if items[2] == 'kB':
                            return mem_total * 1024
                        else:
                            return mem_total
            fd.close()
    except Exception:
        pass
    return
