Created
November 28, 2012 22:09
-
-
Save jacobat/4165023 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
def print_memory_usage | |
memory_usage = `ps -p #{Process.pid} -o rss=`.chomp | |
puts "Memory usage: #{memory_usage}" | |
end | |
print_memory_usage | |
a = ['a'] * 10000000 | |
print_memory_usage | |
a = nil | |
GC.start | |
print_memory_usage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Memory usage: 4160
Memory usage: 82432
Memory usage: 82436