Questions tagged [jvmti]

JVMTI is the Java Virtual Machine Tool Interface, a native API by which authors can write JVM plugins to monitor or modify the execution of a Java Virtual Machine.

Documentation for the current JVMTI 1.2. Home page for JVMTI in JDK 7.

JVMTI was introduced in JDK 5. It replaces Java Virtual Machine Profiler Interface (JVMPI) and the Java Virtual Machine Debug Interface (JVMDI).

214 questions
1
vote
1 answer

Taking periodic thread dumps on JVM - ThreadMXBean vs JVMTI agent

I am trying to build a system that takes periodic thread dumps on JVM processes so that they can be analyzed later in case of issues. I intent to cause minimum overhead to JVM while taking thread dumps. There are multiple ways for taking thread…
Aniket
  • 21
  • 4
1
vote
1 answer

the same kind JVMTI EVENT processed by the same one thread?

I register a JVMTI Event MethodEntry and its callback function is tdMethodEntry and if there are many many MethodEntry Events and my question is that these event will be processed by the same thread through queue? or be processed by several…
nail fei
  • 2,179
  • 3
  • 16
  • 36
1
vote
1 answer

Method Agent_OnLoad is called after shutdown jvm

I wrote simple agent: JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved) { printf("Agent start"); } And simple client: public class Agent { //java -agentpath:/path_to_lib Agent public static void main(String[] args)…
1
vote
1 answer

Why doesn't my makefile with include header work?

I have the following makefile (for c++) LDLIBS=$(shell root-config --libs) INCLUDE= -I/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/include \ …
One Two Three
  • 22,327
  • 24
  • 73
  • 114
1
vote
1 answer

when execute Agent_UnLoad() method about "java -agentpath:c:/tool.dll javaClass

I just start learning JVM TI. About the java command: java -agentpath:../tool.dll javaClass, I know that there is a Agent_OnLoad() method in dll and maybe it set some event callback method. And I know the jvm execute Agent_OnLoad() first and then…
nail fei
  • 2,179
  • 3
  • 16
  • 36
1
vote
2 answers

How to debug a java app that uses a JVMTI agent to set breakpoint (Unable to get necessary JVMTI capabilities)

I would like to debug java applications that are using a jvmti agent I have written. This seems to only work if the jvmti agent is NOT trying to enable "can_generate_breakpoint_events" capabilities. Trying to enable the breakpoint capabilities and…
Haasip Satang
  • 457
  • 3
  • 17
1
vote
1 answer

Are object tags set by the JVM visible to JVMTI agents?

JVMTI agents often need to traverse the Java heap and visit each live object precisely once. One technique is to call FollowReferences and avoid traversing a given object more than once by: Tagging each object visited using SetTag, and Filtering…
glyn
  • 1,180
  • 8
  • 19
1
vote
2 answers

Access thread local variable in JVMTI Agent

I have got the hold of a jthread in particular event in JVMTI agent. How do I get: access to thread local variable the thread name and id from within the JVMTI agent?
jmj
  • 237,923
  • 42
  • 401
  • 438
1
vote
0 answers

Is it possible to get RuntimeVisibleAnnotations from JVMTI or JNI?

In the JVM and the JNI documentations I can't find a reference for RuntimeVisibleAnnotations. Is it possible (eventually with constant pool) to get the annotations?
Christian Ammer
  • 7,464
  • 6
  • 51
  • 108
1
vote
1 answer

how do I get class name from jobject in jvmti

I am trying to get the class name from jobject in jvmti, I tried get (*jvmti)->GetClassSignature(jvmti, object_klass, &signature, &generic); for code like this public static void main(String arg[]) throws Exception { Set names = new…
user3833308
  • 1,132
  • 3
  • 14
  • 39
1
vote
1 answer

JVMTI Tags in HeapDump or separate mapping file

In addition to the information in a heap dump I need to also get the information about potential tags set to an object via JVMTI. Ideally, these values should be stored directly in the heap dump together with the rest of the instance information,…
Haasip Satang
  • 457
  • 3
  • 17
1
vote
0 answers

Is it necessary to create an agent thread to monitor Garbage Collector activity in Java applications through JVMTI?

I'm interested on knowing when the Garbage Collector starts & ends during the execution of a Java application. I've been reading the JVMTI documentation which provides this kind of information…
Harald
  • 3,110
  • 1
  • 24
  • 35
1
vote
1 answer

Strange Java exception java.util.zip.ZipException: error in opening zip file

I wrote JMTI agent for get exceptions from app: #include #include void printStackTrace(JNIEnv* env, jobject exception) { jclass throwable_class = (*env).FindClass("java/lang/Throwable"); jmethodID print_method =…
Rinat Mukhamedgaliev
  • 5,401
  • 8
  • 41
  • 59
1
vote
1 answer

JVMT exception monitor

How to get exception stack trace with JVMTI. I wrote simple code for handle exception, but i want handle number of line of exception. How to obtain this number? #include #include #include "agent.h" void printStackTrace(JNIEnv*…
Rinat Mukhamedgaliev
  • 5,401
  • 8
  • 41
  • 59
1
vote
0 answers

JVMTI heap dump on Exception - stacktrace issues

I've been fiddling with JVMTI API, trying to write something useful. Pasting code from other SO questions together, I've attempted to create a simple tool which would dump the heap when some particular kind of exception occurs, possibly useful in…
Thirteenth Seeker
  • 333
  • 1
  • 3
  • 5