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

Dynamic Bytecode Instrumentation fails without any error

Objective I'm doing dynamic bytecode instrumentation using a JVMTI agent. I have to instrument those methods which are "hot", that is, the methods which invoke JIT compiler. To do so I listen to a CompiledLoadEvent and inside its call back function,…
Saqib Ahmed
  • 1,056
  • 14
  • 33
2
votes
1 answer

How to get a class file (in specification format) during runtime using JVMTI?

I am working on a research project which includes Hotspot profiler's feedback. Currently I am working on a JVMTI agent which should have following features: listen any compiled load event. Extract and analyse the complete class file which has…
Saqib Ahmed
  • 1,056
  • 14
  • 33
2
votes
1 answer

Profile Nashorn Javascript execution?

When using JProfiler 9.1 to profile a JVM (1.8.0_65-b17 on Mac) running Javascript code through Nashorn, it turns out that calls into javax.script.ScriptEngine.eval() cannot be further profiled: The nashorn-dev mailing list seems to say that…
jfrantzius
  • 623
  • 7
  • 16
2
votes
2 answers

How to get parameter values in a MethodEntry callback

I have the following java code public class Test { public void sayHello(String msg) { System.out.println(msg); } } new Test().sayHello("Bonjour"); I have a jvmti agent attached to java where I catch function calls. I want to get…
Oleg Pavliv
  • 20,462
  • 7
  • 59
  • 75
2
votes
2 answers

How to trace java application in "dtrace style"?

I have task of tracing some java application with dynamic probes (like dtrace or systemtap). Of course, it should be done without application restarts or recompiles. It should allow dynamic setting of interceptors on methods calls and internal JVM…
dmitrievanthony
  • 1,501
  • 1
  • 15
  • 41
2
votes
1 answer

Starting JVM Tool Interface agents in the VM during live phase

The JVM Tool Interface(JVMTI) specification says that the JVMTI agents can be started in the VM during live phase but they havent mentioned how it can be done. Has anyone tried this before or got any hints on how to do it?
MohamedSanaulla
  • 6,112
  • 5
  • 28
  • 45
2
votes
1 answer

Failed to redefine class When I try to retransform class

I was trying to modify class dynamically, such as call sleep() before a line. I attached agent to a jvm during runtime using Attach method. Then I got target class from jvm, and modified it(Add a line to call sleep()). And I got redine class error.…
Nick Dong
  • 3,638
  • 8
  • 47
  • 84
2
votes
1 answer

Using jpda to connect to weblogic

I am building a utility/tool to profile/trace the method calls in a Java EE application deployed in Weblogic 10 (java 6). The intention is to quickly understand the flow of events in our huge enterprise application. (Going through the code is…
MVK
  • 125
  • 2
  • 9
1
vote
1 answer

Anyway to get jthread tid through JVMTI?

There is an function of JVMTI called GetAllThreads. But we can only get jthread object. Is there any way to get the tid for a jthread object? By tid I mean kernel thread id returned by gettid() system call.
1
vote
2 answers

Perplexed by jvmti object allocation callback behavior

Can anybody explain to me why can I get a callback when jvm allocates some java objects, but not others? Here is what I am doing: static jvmtiCapabilities capa; static jvmtiEnv* jvmti = NULL; static const char* …
Nikita Visnevski
  • 147
  • 2
  • 11
1
vote
1 answer

Using JNI / JVMTI - How to determine if jfieldID is static or not

If I use jvmti_env->GetClassFields(objClass, &numOfFields, &fieldIds); I still have to decide whether to call GetStaticField or GetField. How do I determine which one to use? I know that in java.lang.reflect.Field I can query fields'…
Chen Harel
  • 9,684
  • 5
  • 44
  • 58
1
vote
1 answer

How to get the memory address(not the hashcode) of a java object using JVMTI

I am a beginner in C and C++ and I don't know very well how to use the JVMTI. I want to get the physical memory location (in hexadecimal) of a java object. Is it possible? I don't want to get answers like "get it from this profiler etc" ... So far…
dm_poy
  • 39
  • 1
  • 8
1
vote
1 answer

compiling a jvmti agent with g++ fails to work, but cc works ok

I have a very simple agent, basically just the required Agent_OnLoad method signature. If I compile it with g++. g++ -g -fno-strict-aliasing -fPIC -fno-omit-frame-pointer -W -Wall -Wno-unused -Wno-parentheses -I. -I../agent_util…
user1040768
  • 48
  • 1
  • 5
1
vote
1 answer

How to set -javaagent differently?

I need to load a java agent without setting -javaagent. The reason why I need to do this is I have an exe that starts a JVM with command line args specified in a file. This exe filters -javaagent. How can I do this? I must load this agent via a…
Code Base
  • 93
  • 8
1
vote
1 answer

How to receive breakpoint events by jvmti, from remoting debugger?

There is a jvm in a shared vm. Other developer may remote debugging by idea, and cause hang up at breakpoints. In some reason, I need to continue the process. I've programed an agent with jvmti, tried to receive breakpoint events for clearing them.…
T. Chen
  • 41
  • 4