lib/rbbt/util/misc/development.rb in rbbt-util-5.37.3 vs lib/rbbt/util/misc/development.rb in rbbt-util-5.37.4
- old
+ new
@@ -397,10 +397,10 @@
end
end
def self.memory_use(pid=nil)
pid ||= $$
begin
- CMD.cmd("grep 'VmRSS:' /proc/#{pid}/status").read.scan(/\d+/).first.to_i
+ Open.read("/proc/#{pid}/status").match(/VmRSS:\s+(\d+)/)[1].to_i
rescue ProcessFailed
raise "Process with #{pid} not found"
end
#`ps -o rss -p #{pid || $$}`.strip.split.last.to_i
end