def get_by_pgid_linux(pgid)
      output, _, status = Open3.capture3('ps', '-o', 'pgid=', '-o', 'rss=')
      if status.success?
        targets = output.split("\n").select {|line| line.split(' ').first == pgid.to_s }
        calculate_sum(targets.map {|line| line.split(' ')[1] })
      else
        nil
      end
    end
def get_by_pgid_linux(pgid)
      output, _, status = Open3.capture3('ps', '-o', 'pgid=', '-o', 'rss=')
      if status.success?
        targets = output.split("\n").select {|line| line.split(' ').first == pgid.to_s }
        calculate_sum(targets.map {|line| line.split(' ')[1] })
      else
        nil
      end
    end
Note:
   taiki-ono@ci-slave-ruby-001:~$ ps -o pgid= -o rss=
   22848   888
   25848  4056