VisualVM is a modern tool that gives you graphs on CPU, GC activity + memory (heap and metaspace), load/unloaded classes, and live threads. With a sampler you can dive deeper.
JConsole has some overlap, but I use it additionally to look into Mbeans (JMX). Also additional I use Eclipse Memory Analyzer to analyze heap dumps for example created with VisualVM. Threre are also all in one tools such as JProfiler, but those are commercial offerings.
If you are already used to VisualVM, you should install the MBeans Browser plug-in, see official VisualVM website: https://visualvm.github.io/plugins.html This plug-in is similar to what JConsole could offer but in the UI you are used to (IMHO, JConsole's UI feels very outdated).
Another tool that integrates such functionality nicely is Java Mission Control, but depending on the JDK you are using it's probably an extra (free) download. As others have pointed out, the main advantage of JConsole is that it's already on your computer ;-).
This is the most important part...yes there are better tools for monitoring and profiling, but if you're at a random customer installation and you need a quick peak...having a tool ready and sitting there is very nice.
How useful JMX beans are depends on your application and used libraries/frameworks, not all publish useful JMX beans.
The memory viewer is pretty basic, but it can quickly confirm if you're dealing with a potential memory leak or not. Forcing (ok requesting) the GC to run and a graph to see if your baseline keeps increasing.
The thread viewer is also pretty basic, but it can quickly confirm if you have a deadlock or hotspots in your code (when the stack doesn't move between manual refreshes).
I have used it in the past for doing some detailed app performance testing and tuning - 1000+tps kind of stuff for an Apache Camel implementation. Useful when logs dont give you the dimensions like in multi-threaded processing
JConsole is simply a tool to access Java Management Extensions (JMX) MBeans. MBeans are software components used to monitor an app at runtime. Other tools besides JConsole can also be used to access MBeans.
Implementations of Java typically come with some MBeans built into the JVM. You can use any MBeans monitoring tool, including JConsole, to access information revealed in those particular MBeans such as memory utilization within the JVM. You may find those JVM MBeans useful. But VisualVM is a more full-featured tool dedicated to monitoring the JVM.
Certain frameworks and libraries you leverage in your app may include MBeans for you to monitor and administer its features at runtime. For example, Apache Tomcat comes with some MBeans as I recall. And you can write your own MBeans to monitor and administer your app’s features at runtime.
JConsole can be used to access any of those MBeans at runtime. Or you may choose to use other tools to access those MBeans at runtime.
Sure, it looks AI generated, but it's also probably the best answer.
I feel like JMX is underutilized. It's one of those oddities of the JVM platform that doesn't get much hype. JConsole is nice because 1) you will already have it and 2) it's focused on JMX. It has some out of the box visualizations for heap memory and such, but mostly because that's what is exposed out of the box over JMX.
So, you can use VisualVM with an additional plugin to access JMX, or you can use the tool that's focused on JMX to do it. Both have limitations. You can inspect and set simple values of MBeans, but MBeans can expose a lot of functionality that you'd actually need to write code to interact with, like downloading/uploading files, streaming data, etc. For instance, JaCoCo's MBean interface is the only way to extract coverage data without having to stop the process being monitored, but you won't be able to do it with the JConsole UI (or VisualVM + JMX plugin) alone, code is required.
Question: have you ever bound jconsole/jmx to an execution of "mvn verify" ? I would interested to get some performance profiles in an automated fashion for some integration tests
to see CPU usage, the Java methods that execute the most, GC pause statistics, and where most allocations occur, or you can use the API in jdk.jfr.consumer to make sure you don't introduce regressions:
why not enable a flight recording instead by making a .mvn/jvm.config file with the JVM flags, and just pass that jfr file to JMC or similar afterwards?
36
u/Deep_Age4643 May 23 '26
VisualVM is a modern tool that gives you graphs on CPU, GC activity + memory (heap and metaspace), load/unloaded classes, and live threads. With a sampler you can dive deeper.
JConsole has some overlap, but I use it additionally to look into Mbeans (JMX). Also additional I use Eclipse Memory Analyzer to analyze heap dumps for example created with VisualVM. Threre are also all in one tools such as JProfiler, but those are commercial offerings.
12
u/Minute_Owl3430 May 23 '26
If you are already used to VisualVM, you should install the MBeans Browser plug-in, see official VisualVM website: https://visualvm.github.io/plugins.html This plug-in is similar to what JConsole could offer but in the UI you are used to (IMHO, JConsole's UI feels very outdated).
Another tool that integrates such functionality nicely is Java Mission Control, but depending on the JDK you are using it's probably an extra (free) download. As others have pointed out, the main advantage of JConsole is that it's already on your computer ;-).
4
u/Scf37 May 23 '26
Not really missing anything but jconsole is included in every jdk distribution.
3
u/portecha May 23 '26
Jconsole is what us old people used to use before visual VM.
Nah really it's just the legacy version of what became visualvm
2
u/Riist138 May 24 '26
Jconsole is good for monitoring JMX..VisualVM just takes the cake, much better features and interface imho.
2
u/benevanstech May 23 '26
There is absolutely no need to still be using JConsole in this day and age.
VisualVM + the MBeans plugin does everything JConsole does, and a great deal more besides.
1
u/15526s May 23 '26
I used it for the first time last month. Didn't know what I was doing
1
u/stfm May 23 '26
I have used it in the past for doing some detailed app performance testing and tuning - 1000+tps kind of stuff for an Apache Camel implementation. Useful when logs dont give you the dimensions like in multi-threaded processing
1
u/[deleted] May 24 '26
used to use to profile with it
1
u/Joram2 May 26 '26
Who uses JConsole or VisualVM any more? Aren't tools like Prometheus and similar modern metrics tools, better options?
1
u/Terrible_Phase_2429 May 26 '26
Via JConsole, ou VisualVM posso manipular o conteúdo de um objeto ? Não tenho muito conhecimento sobre.
0
u/jarrod_barkley May 23 '26 edited May 23 '26
JConsole ⇔ JMX
JConsole is simply a tool to access Java Management Extensions (JMX) MBeans. MBeans are software components used to monitor an app at runtime. Other tools besides JConsole can also be used to access MBeans.
Implementations of Java typically come with some MBeans built into the JVM. You can use any MBeans monitoring tool, including JConsole, to access information revealed in those particular MBeans such as memory utilization within the JVM. You may find those JVM MBeans useful. But VisualVM is a more full-featured tool dedicated to monitoring the JVM.
Certain frameworks and libraries you leverage in your app may include MBeans for you to monitor and administer its features at runtime. For example, Apache Tomcat comes with some MBeans as I recall. And you can write your own MBeans to monitor and administer your app’s features at runtime.
JConsole can be used to access any of those MBeans at runtime. Or you may choose to use other tools to access those MBeans at runtime.
1
u/vmcrash May 23 '26
No, for what is it useful?
1
u/m_adduci May 23 '26
Question: have you ever bound jconsole/jmx to an execution of "mvn verify" ? I would interested to get some performance profiles in an automated fashion for some integration tests
-4
u/revilo-1988 May 23 '26
Ja und es ist nützlich