Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'get_process_mem'
require 'rusage' # gem install rusage
require 'benchmark'
n = 2000
gpm = GetProcessMem.new
Benchmark.bm(10) do |x|
x.report("gpm:") { n.times do gpm.mb end }
x.report("rusage:") { n.times do Process.rusage.maxrss end }
end
gpm.mb
Process.rusage.maxrss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.