'Convert status to string array.
:param pids: List of PIDs you intend to control. Use pids=[] to control
all defined PIDs.
:return: String format to table.'

def get_mem_status_string(self, pids=[]):

    if (pids == []):
        pids = self.pids
    headers = ['NAME', ('%7s' % 'PID'), ('%8s' % 'TOTAL/VMSIZE'), ('%8s' % 'FREE/VMRSS'), ('%8s' % 'BUFFERS/VMPEAK'), ('%8s' % 'CACHED/VMSWAP'), ('%11s' % 'TIME')]
    textstatus = []
    for pid in pids:
        stat = self.stats[pid][2].get_status()
        time = stat[1]
        stat = stat[0]
        textstatus.append([('%s' % self.stats[pid][0]), ('%7s' % pid), ('%10dMB' % (stat[0] / 1024)), ('%8dMB' % (stat[1] / 1024)), ('%12dMB' % (stat[2] / 1024)), ('%11dMB' % (stat[3] / 1024)), ('%10.3fs' % time)])
    return matrix_to_string(textstatus, tuple(headers))
