def get_memory_usage():
 pid = os.getpid()
 process = subprocess.Popen(("ps -o rss %s | awk '{sum+=$1} END {print sum}'" % pid), shell=True, stdout=subprocess.PIPE)
 stdout_list = process.communicate()[0].split('\n')
 return int(stdout_list[0])

def get_memory_usage ( ) : pid = os . getpid ( ) process = subprocess . Popen ( ( "ps -o rss %s | awk '{sum+=$1} END {print sum}'" % pid ) , shell = True , stdout = subprocess . PIPE ) stdout_list = process . communicate ( ) [ 0 ] . split ( '\n' ) return int ( stdout_list [ 0 ] )
return int containing memory used by this process .