Skip to content

Instantly share code, notes, and snippets.

@npow
Created August 9, 2012 02:37
Show Gist options
  • Save npow/3300428 to your computer and use it in GitHub Desktop.
Save npow/3300428 to your computer and use it in GitHub Desktop.
JS Heap Size
#!/usr/bin/env ruby
require 'rubygems'
require 'watir-webdriver'
browser = Watir::Browser.new :chrome, :switches => %w[--enable-memory-info --enable-popup-blocking]
browser.goto 'file:///Users/npow/code/hydrogen/test.html'
browser.execute_script "document.getElementById('usedJSHeapSize').innerHTML = console.memory.usedJSHeapSize;"
hs = browser.div(:id => 'usedJSHeapSize')
puts hs.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment