concept JVMTI in category osgi

This is an excerpt from Manning's book OSGi in Action: Creating Modular Applications in Java.
Low-level monitoring is possible using the JVM Tools Interface (JVMTI, http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html). JVMTI is a native API that provides several ways to interrogate, intercept, and introspect aspects of the JVM such as the Java heap, locks, and threads. There are open source agents that can analyze the heap to find leak candidates. It should be possible to take these generic agents and develop them further to add knowledge about OSGi resources, so they can watch for references to OSGi service instances on the Java heap and determine which bundle is responsible for holding on to them. A recent example of this is the OSGi inspector agent (http://wiki.github.com/mirkojahn/OSGi-Inspector).