I just start learning
JVM TI
. About the java command: java -agentpath:../tool.dll javaClass, I know that there is aAgent_OnLoad()
method indll
and maybe it set some eventcallback method
. And I know the jvm executeAgent_OnLoad()
first and then executejavaClass
.And theAgent_OnUnLoad()
is also called by jvm.
Then the problem comes, how the jvm know when call Agent_OnUnLoad() method
. At First, I think that after javaClass
is executed jvm will calls Agent_OnUnload()
, but then I discard this thought because at this time, maybe the dll
is doing sth e.g. writing data to disk.
So how jvm know it is the right time to call Agent_OnUnLoad() method?
condition
that theAgent_OnUnload
is called and the jvm is still running. For example, I have ATest.java,BTest.java...ZTest.java and the *execute order* maybeAgent_Onload
*ATest.java BTest.java*...Agent_OnUnload
...*ZTest.java* that is to say, ***the Agent_OnUnload is called and jvm go runing *** – nail fei Oct 18 '16 at 01:47