jmhodges (owner)

Revisions

gist: 133045 Download_button fork
public
Public Clone URL: git://gist.github.com/133045.git
Embed All Files: show embed
watch_mem.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
unless ARGV[0]
  STDERR.puts "Hey, you suck. Include a process name to look for"
  exit(1)
end
 
loop do
  resident_mem =
    `ps vx | grep -v grep | grep -v #{$0} | grep -i #{ARGV[0]}`.split(' ')[7]
  puts "#{Time.now.to_i} #{resident_mem}" if resident_mem && !resident_mem.empty?
  STDOUT.flush
  sleep 1
end