Skip to content

Instantly share code, notes, and snippets.

@jmesnil
Created August 1, 2008 17:46
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 jmesnil/3647 to your computer and use it in GitHub Desktop.
Save jmesnil/3647 to your computer and use it in GitHub Desktop.
#!/usr/bin/env jruby
require 'rubygems'
require 'jmx4r'
require 'jconsole'
mem_pools = JMX::MBean.find_all_by_name "java.lang:type=MemoryPool,*"
mem_pools.each do |pool|
# print the 'name' property of the pool's ObjectName
puts pool.object_name["name"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment