3

When using jcmd to monitor java process, there is a command ManagementAgent.start.

Checking man page / oracle document / google, didn't found any description.

The question is:

  • What is it used for?

2 Answers 2

5

This command starts remote JMX agent as if -Dcom.sun.management.jmxremote command-line argument is set. See Monitoring and Management Using JMX Technology.

Sign up to request clarification or add additional context in comments.

Comments

0

The ManagementAgent commands of jcmd will call methods of the jdk.internal.agent.Agent class on the target JVM:

  • start calls startRemoteManagementAgent(),
  • start_local calls startLocalManagementAgent(),
  • stop calls stopRemoteManagementAgent(),
  • status calls getManagementAgentStatus().

Basically, what the first two do is start a JMX connector server (each with different parameters) for the platform MBean server of the target JVM. The status command is useful to get information about the running JMX agents.

Source code for start_local: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/services/diagnosticCommand.cpp#L736

Comments

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.