The Source for Java Technology Collaboration
User: Password:



Kelly O'Hair's Blog

August 2005 Archives


VM Agents and JVM TI

Posted by kellyohair on August 23, 2005 at 09:19 PM | Permalink | Comments (0)

The JDK 5.0 (Tiger) and JDK 6.0 (Mustang) binary images include the source and binaries of quite a few demo Java Virtual Machine Tool Interface (JVM TI) agents (native libraries) in the demo/jvmti directory. The more curious people might be interested in the detailed description in my blogs.sun.com site on using VM agents. Certainly writing VM Agents is not something that we want thousands of people doing, besides everyone wants to write in Java anyway, right? But for anyone that needs the tool functionality we certainly have it now in JDK 5.0.

The DVM Agent for use with Solaris Dynamic Tracing (DTrace) is a good example of the capabilities of JVM TI. The Heap Profiling Agent (HPROF) in JDK 5.0 uses JVM TI as does the debugger backend that implements the Java Debugger Wire Protocol (JDWP). JVM TI in combination with Java Native Interface (JNI) creates a very robust and complete set of native interfaces for agent development.

Tools written in Java can use the Java Debug Interface (JDI) and java.lang.instrument (which was added in JDK 5.0 and uses JVM TI under the covers). In the future expect to see extensions to both these Java level interfaces, all courtesy of the basic functionality of JVM TI and JNI.

We are also interested in adding useful tool demos to the JDK or improving the ones we have, so if you have an idea for a useful agent or tool, consider creating a java.net project and/or contributing it to the JDK.

For anyone converting older JVMPI agents to JVM TI, there is an article on The JVMPI Transition to JVM TI.



Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds