Skip to content

Instantly share code, notes, and snippets.

@hlcfan
Created July 13, 2016 06:33
Show Gist options
  • Select an option

  • Save hlcfan/369a0673a36f6c3d99fc3bccfd1d729f to your computer and use it in GitHub Desktop.

Select an option

Save hlcfan/369a0673a36f6c3d99fc3bccfd1d729f to your computer and use it in GitHub Desktop.
Output how much memory used
# gem 'get_process_mem'
def print_usage(description)
mb = GetProcessMem.new.mb
puts "#{ description } - MEMORY USAGE(MB): #{ mb.round }"
end
def print_usage_before_and_after
print_usage("Before")
yield
print_usage("After")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment