http://download.oracle.com/javase/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getGarbageCollectorMXBeans() <http://download.oracle.com/javase/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getGarbageCollectorMXBeans()>exposes some of the info
Unfortunately you can't get at any of the really juicy details like CMS FLS statistics :( -Todd On Mon, Feb 7, 2011 at 10:49 AM, tsuna <[email protected]> wrote: > On Mon, Feb 7, 2011 at 10:26 AM, Ted Yu <[email protected]> wrote: > > About 'number of GC cycles per GC type', is there API to get this > > information ? > > As far as I know this is only exposed through JMX. I'm sure there is > a way to use some horrible APIs in the JDK to "efficiently" access JMX > stuff from the local JVM. If there's another way than JMX, I'd love > to know. > > The way I collect HBase metrics for OpenTSDB is to use the Sun private > API to attach to the JVM and get a JXM URL, even if the VM wasn't > configured to expose any JMX thing on a port. I think under the hood > it starts a thread in the remote JVM to handle RMI calls that probably > go over the loopback interface. This is pretty much how jconsole and > friends work, BTW. Pretty horrible stuff. :( > > -- > Benoit "tsuna" Sigoure > Software Engineer @ www.StumbleUpon.com > -- Todd Lipcon Software Engineer, Cloudera
