Starting JVM Tool Interface agents in the VM during live phase

主宰稳场 提交于 2020-01-15 03:40:07

问题


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?


回答1:


You can use method

   * @param   agent
   *          Path to the JAR file containing the agent.
   *
   * @param   options
   *          The options to provide to the agent's <code>agentmain</code>
   *          method (can be <code>null</code>).

   com.sun.tools.attach.VirtualMachine.loadAgent(String agent, String options)

from ${java.home}/../lib/tools.jar



来源:https://stackoverflow.com/questions/2125805/starting-jvm-tool-interface-agents-in-the-vm-during-live-phase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!