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
0 answers

-XX:NativeMemoryTracking=summary saves Memory Usage

Recently i encountered a problem in my system that is java used more RAM memory almost near 6 GB of RAM out Of 8GB. So i decided to dig further which part takes more memory with the help of -XX:NativeMemoryTracking=summary. After enabling this parm…
Muniyasamy V
  • 81
  • 1
  • 4
  • 9
0
votes
2 answers

JVMTI Agent_OnLoad handler can't create a System Property

I'm using the JVM Tool Interface. I'm trying to create a SystemProperty in the Agent_OnLoad event using the SetSystemProperty() call. If the property exists, it correctly sets a new value. However, if the property does not exist, SetSystemProperty…
Dave C
  • 1,572
  • 4
  • 23
  • 34
0
votes
1 answer

Is it possible for one Java native agent to access symbols exposed by another Java native agent?

I have two Java native agents to be used via the "-agentpath" argument and I want to share some state via global variables between these two native agents. If I export a global variable in one native agent, can it be accessed by the other native…
brian
  • 265
  • 1
  • 9
0
votes
0 answers

JNIEnv->GetMethodID leads a crash

jclass clazz_obj = jni_env->GetObjectClass(klazz); jmethodID mid = jni_env->GetMethodID(clazz_obj, "getName", "()Ljava/lang/String;"); This is the stacktrace: V [libjvm.so+0x74e290] JvmtiRawMonitor::is_valid()+0x0 C [libVWave.so+0x73cd0] …
Ahba1
  • 1
0
votes
1 answer

JVMTI Allocate/Deallocate and malloc/free

Is it possible to have memory managed by JVMTI Allocate/Deallocate and malloc/free simultaneously in one JVMTI Agent? I know I can not free memory that was allocated by JVMTI Allocate with free and not use JVMTI Deallocate to free memory that was…
spreiter301
  • 314
  • 1
  • 12
0
votes
1 answer

Is there any way to access a Java method/function local variables and local object instances through JNI

public class some_class { public static void som_func() { var some_object = new SomeObject(); var ret = 0; do { ret = some_object.DoSomething(); } while(ret != 1); …
0
votes
0 answers

Starting Java Agent on Java Applet (jp2launcher)

I want to start a Java agent on a Java applet running on jp2launcher. I manage to attach to jp2launcher.exe using this jattach tool and I can inspect that my agent .jar file gets loaded, but neither my preMain or agentMain gets called. The same…
crankedrelic
  • 463
  • 1
  • 5
  • 14
0
votes
1 answer

How to track locking events in JVMTI

JVMTI offers the events ContendedMonitorEnter and ContendedMonitorEntered to detect events related to the use of synchronized. synchronized is nothing else, but a ReentrantLock. Now I would like to track also events related to the lock structure:…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
0
votes
1 answer

Retrieve jobject within MethodEntry /MethodExit in JVMTI

Is it possible to retrieve the current jobject when the method entry or method exit event is triggered? I would like to tag the jobjects which are entered on certain methods. Currently I can only retrieve the method defining class, but not the…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
0
votes
1 answer

What is diff between JVMTI_EVENT_COMPILED_METHOD_* and JVMTI_EVENT_DYNAMIC_CODE_GENERATED?

Help me to understand difference between JVMTI_EVENT_COMPILED_METHOD_* and JVMTI_EVENT_DYNAMIC_CODE_GENERATED for OpenJDK 8. I counts this events for visualization at Grafana but don't understand them to the end. Maybe it is "Interpretator" and…
srg321
  • 105
  • 7
0
votes
0 answers

How to create new String value in Java JDI?

I'd like to invoke a method in JDI which has String as a parameter. So first I will have to create a String value(com.sun.jdi.Value) but the only way which comes to my mind is to use the newInstance() method on ClassType, but this method also takes…
Nfff3
  • 321
  • 8
  • 24
0
votes
0 answers

How to disable all EventRequsts inside JDI?

To disable all EventReqeusts inside JDI, currently I am using: private void disableRequest(EventRequest request, List < EventRequest > disabled) { request.disable(); disabled.add(request); } ... List requests = new…
Nfff3
  • 321
  • 8
  • 24
0
votes
0 answers

How to check if ClassType inherits from java.util.Collection in JDI?

I can get all the interfaces of a ClassType with allInterfaces() but this results in many JDWP calls to the debuggee which is slow. Another approach would be to check this: Collection.class.isAssignableFrom(classType) but the method…
Nfff3
  • 321
  • 8
  • 24
0
votes
1 answer

How to know if an `com.sun.jdi.ObjectReference` is an Enum?

How to find out if an com.sun.jdi.ObjectReference instance is an enum? I can get the type of the instance with ObjectReference.type() which gives a ClassType back (if it is a class).
Nfff3
  • 321
  • 8
  • 24
0
votes
1 answer

How to hide variables from Java's JDI?

I am instrumenting some classes and introducing some new local variables. Now, when the user places a breakpoint in the code, and execution is stopped, the newly introduced local variables can be seen inside Intellij IDEA's debugger window. How can…
Nfff3
  • 321
  • 8
  • 24