0.0
No commit activity in last 3 years
No release in over 3 years
A set of GC-monitoring methods for JRuby similar to those in Ruby Enterprise Edition
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme
Title: jruby-gc-stats

Description:

This is a set of GC-monitoring methods for JRuby that mimic behavior of Ruby
Enterprise Edition's GC methods. In our case, these are all implemented in
Ruby, using the JVM's built-in monitoring and management APIs.

Example Usage:

require 'jruby/gc_stats'

require 'pp'
puts "Enabling stats..."
GC.enable_stats
puts "allocation size: #{GC.allocation_size}"
puts "Running loop..."
1_000.times {
  ary = []
  1_000.times {ary << 'foo' + 'bar'}
}
puts "collections: #{GC.collections}"
puts "time: #{GC.time}ms"
puts "bytes since last GC: #{GC.growth}"
puts "size change: #{GC.allocation_size}"
puts "Dumping..."
GC.dump

puts "Dumping caller for all threads..."
2.times {Thread.new {sleep}}
pp caller_for_all_threads