-
-
Save sshaw/c5d321df26407f1af3fef419cb49334a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'get_process_mem' | |
require 'rusage' # gem install rusage | |
require 'benchmark' | |
n = 2000 | |
gpm = GetProcessMem.new | |
Benchmark.bm(10) do |x| | |
x.report("status:") { n.times do gpm.linux_status_memory end } | |
# In sshaw version | |
x.report("statm:") { n.times do gpm.linux_statm_memory 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
OS
/proc/$$/status
v2.2.4
v2.1.6
/proc/$$/statm
v2.1.6