def memsizeformat(size):
    """Returns memory size in human readable (rounded) form.
    """
    if size > 1048576: # 1024**2
      return "{0} GB".format(size / 1048576)
    elif size > 1024:
      return "{0} MB".format(size / 1024)
    else:
      return "{0} KB".format(size)