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
0
votes
1 answer

'variable JNIEXPORT is not type name'

I don't know why is giving me errors on JNIEXPORT and JNICALL... Info: Visual studio 2017, Windows JAVA_HOME is set. Added the directory in 'C/C++ > General > Additional Include Directories' Include directory > C:\Program…
0
votes
2 answers

JVMTI - Get line number from jvmtiFrameInfo

I have the following code to get the line numbers at the current stack frame locations when an exception is thrown that works but I figured it out by experimenting rather than through a specification. I only left the relevant code. int…
spreiter301
  • 314
  • 1
  • 12
0
votes
1 answer

Deadlock detection with JVMTI

I wonder whether it is possible to detect deadlocks dynamically in Java by using the JVMTI. There are two events indicating actions on monitors using the synchronized statement: Monitor Contended Enter Sent when a thread is attempting to enter a…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
0
votes
1 answer

How to access JVM internal data structures using the Hotspot Dynamic Attach Mechanism?

According to the OpenJDK's website, it is possible to attach a thread to Hotspot (Dynamic Attach API) which can collect information about it. I couldn't find any material on the internet on how to obtain information about Hotspot's internal data…
Nfff3
  • 321
  • 8
  • 24
0
votes
1 answer

Synchronization statistics not available in the JVMTI API?

The class java.lang.ThreadInfo provides some very useful methods which provide statistic concerning synchronization in Java. For instance: getBlockedTime() Returns the approximate accumulated elapsed time (in milliseconds) that the thread…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
0
votes
1 answer

Does class ThreadInfo provide more information than reachable from JVMTI?

This is confusing. The ThreadInfo class provides alot of information, especially statistic of a Thread. However I cannot find such functions in the JVMTI. Is this norma? Do I have to gather the data myself? Do I have to iterate to the ThreadInfo…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
0
votes
0 answers

JVMTI Encrypt&Decrypt Java class file

I'm doing something to encrypt java .class file, and using jvmti agentlib to decrypt the source data. there always an Exception. Error: A JNI error has occurred, please check your installation and try again Exception in thread "main"…
xufeng
  • 55
  • 1
  • 7
0
votes
1 answer

Faster alternative to get tags for objects than JVMTI GetTag

When profiling with async profiler and gperftools I noticed that jvmti->GetTag shows up quite a lot in the results for my agent. When I checked how it is implemented I found the following in the source of jvmitTagMap.cpp: jlong…
Haasip Satang
  • 457
  • 3
  • 17
0
votes
0 answers

How to get executed statements of a method at runtime using JVMTI

We have written a custom tracer using JVMTI which gets the runtime call flow from a Java Application hosted at any server(Tomcat/JBoss). Now, we would like to get the list of executed statements of those methods which are part of runtime call flow.…
NAK
  • 71
  • 1
  • 4
0
votes
1 answer

JVM: Add a hook to Heap Access

I am hoping to do a profiling analysis on my Java project. To get the results I want to add a "hook" to the JVM so that every time a heap access occurs, the "hook" is called and does some tracing. I have been looking into JVMTI but this does not…
Bojian Zheng
  • 2,167
  • 3
  • 13
  • 17
0
votes
1 answer

Editing stacktrace after instrumentation

I have a javaagent that performs some code instrumentation. That of course changes the stack trace for the user, whenever they perform: new Exception().printStackTrace() And it also affects other services Throwable.class…
user967710
  • 1,815
  • 3
  • 32
  • 58
0
votes
1 answer

Why does the JVM send multiple JVMTI ClassLoad events for the same class?

I enabled JVMTI ClassLoad events which are supposed to be generated when a class is first loaded. I expected to get this event exactly once per class that was loaded but for some classes it seems to be generated multiple times, e.g. this one I get…
Haasip Satang
  • 457
  • 3
  • 17
0
votes
0 answers

What is the preferred way communicating with JVMTI agent?

I'm writing some simple monitoring tool to take some general metrics from a running JVM using JVMTI. I'm intended to send this metrics data to Zabbix or Graphite in order to analyze later. What is the preferred way to communicate with agent? The…
Some Name
  • 8,555
  • 5
  • 27
  • 77
0
votes
0 answers

Deterministic class loading - Control thread which loads a class

I am working on a research project for deterministic fault reproduction in the JVM and am struggling to make classloading deterministic between different app runs. By that I mean that I want to ensure that always the same thread loads a class that…
Haasip Satang
  • 457
  • 3
  • 17
0
votes
0 answers

Is it possible to instrument Object class by JDI?

I'm trying to create some instrumentation tool. I want to track each object allocation. The simplest idea that came to my mind was to retransform Object constructor as each object calls it (I know that arrays are initialized differently). I tried…