previous      content      next
About JVMTI (advanced topic)

This is an advanced topic. It provides details that you do not normally have to know to profile your applications. Read the following if you want to learn more about profiling capabilities provided by different versions of Java.

What a Java profiling API is

Any profiler, in order to provide profiling results, communicates with JVM by means of a special API. This API provides different services and influences the range of a profiler's capabilities.

JVMTI, the new standard API (Java 5 and newer)

Starting with Java 5, a new standardized API was introduced - JVMTI (http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/index.html). It had replaced JVMPI API used in previous Java versions.

JVMTI utilizes so-called "bytecode instrumentation". This means that profilers, in order to collect profiling information, should modify the bytecode of profiled application, inserting at certain points some supporting bytecode instructions. There may be some performance issues because of this.

The implementation of JVMTI in Java 5 has several drawbacks (they have been solved in Java 6):

  • parallel garbage collector is not supported (-XX:+UseConcMarkSweepGC, -Xincgc)
  • there is no reasonably fast way to retrieve exact lengths of arrays when capturing a memory snapshot

previous      content      next