In Tomcat Last updated:
Share on:
Cloudways offers managed cloud hosting for any size business to host a website or complex web applications.

 JMX (Java Management Extension) is a very powerful technology, which lets you administer, monitor and configure Tomcat MBeans.

If you are a Tomcat administrator, then you should be familiar with how to enable JMX in tomcat to monitor Heap Memory, Threads, CPU Usage, Classes, and configure various MBeans.

In this article, I will talk about how to enable and connect to Tomcat with JConsole.

I assume you have Tomcat installed if not; you can refer installation guide.

  • Go to path where you have Tomcat installed
  • Go to bin folder
  • Create a file as “”
  • Modify file using vi editor and add following
  • Save the file with “:w
  • Change the file permission as executable
chmod 755

Before you start Tomcat to verify JMX, let’s take a look at the above configuration.

  1. – you can modify the port number if you want.
  2. – this means connect without SSL
  3. – this means no authentication needed when you use JMX client to connect to Tomcat instance.

Let’s start the tomcat by script file. Once started, you can verify either using netstat or ps –ef grep command.

To verify using netstat

netstat –anlp | grep 9000 

[root@localhost ~]# netstat -anlp |grep 9000
tcp6       0     0 :::9000                 :::*                   LISTEN     9372/java
[root@localhost ~]#

To verify using ps command

ps –ef |grep jmx

[root@localhost ~]# ps -ef|grep jmx
root       9372     1 0 21:30 pts/0   00:00:04 java -Djava.util.logging.config.file=/home/chandan/Downloads/apache-tomcat-8.0.28/conf/ -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/home/chandan/Downloads/apache-tomcat-8.0.28/endorsed -classpath /home/chandan/Downloads/apache-tomcat-8.0.28/bin/bootstrap.jar:/home/chandan/Downloads/apache-tomcat-8.0.28/bin/tomcat-juli.jar -Dcatalina.base=/home/chandan/Downloads/apache-tomcat-8.0.28 -Dcatalina.home=/home/chandan/Downloads/apache-tomcat-8.0.28 org.apache.catalina.startup.Bootstrap start
root       9816   9781 0 21:46 pts/0   00:00:00 grep --color=auto jmx
[root@localhost ~]#

This concludes jmx is enabled in Tomcat and it’s time to connect using JMX client.

You may use any client, however, to show you I will use jconsole, which comes with java.

Connect Tomcat JMX using Jconsole

  • Go to the path where you have jconsole

Tip: you may use the find command to search if you are not sure.

  • Execute jconsole

This will popup Java Monitoring & Management Console.

  • Select “Remote Process”
  • Enter the server host and port details


  • Click on “Connect”

This will connect to Tomcat and show you very nice graphs of CPU, Memory & Thread usage. This becomes very handy during troubleshooting.


You may also perform GC from the console.

  • Click on Memory tab, and you will see “Perform GC” button


As mentioned at the beginning of the article, you may also configure MBeans for the classes.

This is often used if you have to change the logging or specific parameters at runtime.

So go ahead and play around with Jconsole and JMX. It’s a wonderful tool for troubleshooting and monitoring.

If you are interested in learning more about Tomcat, then check out this tutorial.

Share on:
  • Chandan Kumar
    Chandan Kumar is the founder of Geekflare. He’s helped millions to excel in the digital realm. Passionate about technology, He’s on a mission to explore the world and amplify growth for professionals and businesses.

Thanks to our Sponsors

More great readings on Tomcat

Power Your Business

Some of the tools and services to help your business grow.
  • The text-to-speech tool that uses AI to generate realistic human-like voices.

    Try Murf AI
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.

    Try Brightdata
  • is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.

    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.

    Try Intruder