parameters: (process_name)
return_statement: return mem
docstring: This function is adapted from Fabian Pedregosa's blog post on measuring python memory usage... http://bit.ly/26RguwI
docstring_summary: This function is adapted from Fabian Pedregosa's blog post on measuring python memory usage... http://bit.ly/26RguwI
docstring_tokens: This function is adapted from Fabian Pedregosa s blog post on measuring python memory usage ... http : // bit . ly / 26RguwI
function: def memory_usage_psutil(process_name):
      "This function is adapted from Fabian Pedregosa's blog post on measuring python memory usage... http://bit.ly/26RguwI"
      # return the memory usage in MB
      import psutil
      mem = 0
      pids = get_pids(process_name)
      for pid in pids:
          process = psutil.Process(pid)
          pmem = process.memory_info()[0] / float(2 ** 20)
          mem += pmem
      return mem
function_tokens: def memory_usage_psutil ( process_name ) : # return the memory usage in MB import psutil mem = 0 pids = get_pids ( process_name ) for pid in pids : process = psutil . Process ( pid ) pmem = process . memory_info ( ) [ 0 ] / float ( 2 ** 20 ) mem += pmem return mem