Skip to content

Instantly share code, notes, and snippets.

@cowboyd
Created April 2, 2012 15:17
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 cowboyd/2284276 to your computer and use it in GitHub Desktop.
Save cowboyd/2284276 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'v8'
def print_resources
rss = /\w*[ ]*#{Process.pid}[ ]*([.,\d]*)[ ]*([.,\d]*)[ ]*([\d]*)[ ]*([\d]*)/.match(`ps aux`)[4]
print "resources: #{rss.to_i/1024}MB\n"
end
print_resources
while(true) do
500.times do
context = V8::Context.new
context.eval("1")
end
print_resources
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment