Skip to content

Instantly share code, notes, and snippets.

@BanzaiMan
Created March 4, 2010 06:23
Show Gist options
  • Select an option

  • Save BanzaiMan/321454 to your computer and use it in GitHub Desktop.

Select an option

Save BanzaiMan/321454 to your computer and use it in GitHub Desktop.
Simple GC statistics in JRuby
require 'java'
gcb = java.lang.management.ManagementFactory.getGarbageCollectorMXBeans()
p gcb.inject(0) {|s,gc| s+gc.getCollectionCount}
p gcb.inject(0) {|s,gc| s+gc.getCollectionTime}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment