Skip to content

Instantly share code, notes, and snippets.

@ursm
Created October 14, 2016 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ursm/00961eafc4e18ae9a84244bdeb14b757 to your computer and use it in GitHub Desktop.
Save ursm/00961eafc4e18ae9a84244bdeb14b757 to your computer and use it in GitHub Desktop.
_ = (0..1000000).to_a.map {|i| i * 2 }
# _ = (0..1000000).to_a.map! {|i| i * 2 }
puts File.read("/proc/#{Process.pid}/status").lines.grep(/^VmHWM:/)
# map => VmHWM: 25408 kB
# map! => VmHWM: 17544 kB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment