cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to instrumenting Java on the fly?

grechnev
Participant

Oracle Java supports 2 ways of instrumenting JVM processes:

- via CLI specifying -javaagent:jarpath,

- starting agents after the JVM startup.

Which method does OneAgent use and why?

Why is it not possible to do Java code injection on the fly without java process restart?

See details:

https://docs.oracle.com/javase/7/docs/api/java/lang/instrument/package-summary.html

1 REPLY 1

Julius_Loman
DynaMight Legend
DynaMight Legend

AFAIK OneAgent uses JVMTI to instrument the JVM itself. But there is also a native part of oneagent (library written in C++) linked to your JVM process. I don't think you can add any library with such functionality on the fly to any process.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts