Community Articles
Find and share helpful community-sourced technical articles
Labels (1)

Many times it is needed to monitor the ambari memory usage. JConsole and JVisualVM are the JDK provided JMX client utilities that can be used for the same. Here in this demo we will see how to monitor ambari server's JVM memory using $JAVA_HOME/bin/jvisualvm (same steps will be applicable for jconsole as well)

Step-1). We will need to add the "" related JVM remoted jmx options to the "/var/lib/ambari-server/" as following.

export AMBARI_JVM_ARGS=$AMBARI_JVM_ARGS' -Xms512m -Xmx2048m'

For more information on JVMs standard jmxremote options please refer to : => Enables the JMX remote agent and local monitoring via a JMX connector published on a private interface used by JConsole and any other local JMX clients that use the Attach API. JConsole can use this connector if it is started by the same user as the user that started the agent. No password or access files are checked for requests coming via this connector. => Enables the JMX remote agent and creates a remote JMX connector to listen through the specified port. By default, the SSL, password, and access file properties are used for this connector. It also enables local monitoring as described for the property.


Step-2). Now we will need to restart the ambari server and validate if it has loaded these options properly or not?

# ps -ef | grep AmbariServer
root      8576     1 11 14:32 pts/0    00:01:37 /usr/jdk64/jdk1.8.0_60/bin/java -server -XX:NewRatio=3 -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx2048m -cp /etc/ambari-server/conf:/usr/lib/ambari-server/*:/usr/share/java/postgresql-jdbc.jar org.apache.ambari.server.controller.AmbariServer

Step-3). Now from a remote host (for example on my MAC/Windows) make sure that the ambari server host and the port 4444 ( is accessible or not?

$ telnet    4444
Connected to
Escape character is '^]'.

Step-4). Now on your MAC Or remote Host open the "$JAVA_HOME/bin/jvisualvm" GUI utility and setup the Remote Host as following:

Now we will need to provide the Remote Host details like port number.

We will need to then right click on the newly added connection and then Add a JMX connection as following:

Now we can use various Tabs of jvisualvm to monitor the Ambari JVM





Don't have an account?
Version history
Revision #:
1 of 1
Last update:
‎12-12-2016 03:33 PM
Updated by:
Former Member
Top Kudoed Authors