top of page
Search
devyncictva7

VisualVM: An All-in-One Solution for Java Development and Production



How to Download and Install VisualVM




VisualVM is a powerful tool that provides a visual interface for viewing detailed information about local and remote Java applications while they are running on a Java Virtual Machine (JVM). It integrates and utilizes some of the command-line tools that JDK provides, such as jmap, jstack, jConsole, jstat, and jinfo. It also supports lightweight profiling capabilities, such as CPU sampling, memory allocation tracking, heap dump analysis, thread dump analysis, and more. VisualVM can help you to track memory leaks, analyze heap data, monitor garbage collector and CPU activity, take snapshots, and troubleshoot performance issues.




download visualvm



In this article, we will show you how to download and install VisualVM, how to run it and connect to local and remote applications, how to monitor and profile applications, and how to use plugins and extensions to enhance its functionality.


How to get VisualVM




There are two ways to get VisualVM: as a standalone tool or as an optional component of GraalVM. Both are the same bits with the same features. The standalone tool runs on any compatible JDK, while the component is configured to run using the host GraalVM.


VisualVM has also been distributed in Oracle JDK 68 as Java VisualVM. It has been discontinued in Oracle JDK 9. See the page to learn how to upgrade to the latest VisualVM.


You can download VisualVM from the page on its official website. You can choose between a ZIP archive or a macOS application bundle. You can also download IDE integrations, plugins, offline Javadoc, or previous releases from the same page.


How to run VisualVM




To run VisualVM, you need to unzip the downloaded archive. The archive already contains the top-level visualvm directory. Then you need to start VisualVM by invoking the binary appropriate for your OS: visualvm\\bin\\visualvm.exe or visualvm/bin/visualvm. You may provide additional options to define JDK and/or VisualVM user directory: --jdkhome \"\" --userdir \"\".


The first time that you launch VisualVM you are prompted to accept a license agreement. You can also check for updates or install plugins from the Tools menu.


When you start VisualVM, the main window opens. The main window is divided into two windows. On the left side, you can see the Applications window that shows the list of applications running on the local machine and any connected remote machines. On the right side, you can see different tabs that display information about the selected application.


How to connect to local and remote applications




VisualVM can connect to both local and remote applications for monitoring and profiling purposes. When launched on any machine, it auto-discovers and starts monitoring all JVM applications running locally. However, you need to connect remote applications explicitly.


To connect to a remote application, you need to enable JMX on the remote JVM by adding some system properties when starting the application. For example:


How to download and install VisualVM on Windows


Download VisualVM for Mac OS X


VisualVM download for Linux


Download VisualVM as a GraalVM component


VisualVM standalone tool download


Download VisualVM plugins and integrations


How to upgrade from Java VisualVM to VisualVM


Download VisualVM 2.1.6 latest version


Download previous releases of VisualVM


How to troubleshoot VisualVM download problems


How to use VisualVM to monitor Java applications


VisualVM tutorial for beginners


How to connect VisualVM to remote JVMs


How to profile Java applications with VisualVM


How to analyze heap dumps with VisualVM


How to generate thread dumps with VisualVM


How to take snapshots with VisualVM


How to compare snapshots with VisualVM


How to configure VisualVM settings and options


How to extend VisualVM functionality with plugins


How to integrate VisualVM with Eclipse IDE


How to integrate VisualVM with NetBeans IDE


How to integrate VisualVM with IntelliJ IDEA


How to integrate VisualVM with Maven


How to integrate VisualVM with Gradle


How to integrate VisualVM with Ant


How to integrate VisualVM with JUnit


How to integrate VisualVM with Spring Boot


How to integrate VisualVM with Tomcat


How to integrate VisualVM with WildFly


How to integrate VisualVM with GlassFish


How to integrate VisualVM with Jetty


How to integrate VisualVM with JBoss EAP


How to integrate VisualVM with WebLogic Server


How to integrate VisualVM with WebSphere Application Server


How to integrate VisualVM with Apache Spark


How to integrate VisualVM with Apache Kafka


How to integrate VisualVM with Apache Cassandra


How to integrate VisualVM with MongoDB


How to integrate VisualVM with Redis


How to integrate VisualVM with Elasticsearch


How to integrate VisualVM with Neo4j


How to integrate VisualVM with Couchbase Server


How to integrate VisualVM with Hadoop MapReduce


How to integrate VisualVM with HBase


How to integrate VisualVM with Hive


How to integrate VisualVM with Pig


How to integrate VisualVM with Sqoop


java -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false ...


This will enable JMX on port 9999 without authentication or SSL encryption. For more details on how to configure JMX security, see .


Then you need to add a remote host in VisualVM by right-clicking on the Remote node in the Applications window and choosing Add Remote Host. You need to enter the host name or IP address of the remote machine. Optionally, you can also enter a display name for convenience.


After adding a remote host, you can expand its node and see the list of JMX-enabled applications running on that host. You can double-click on any application to open its tabs in the main window.


How to monitor and profile applications




VisualVM provides several tabs for monitoring and profiling applications, such as Overview, Monitor, Threads, Sampler, Profiler, Heap Dump, and Snapshot. Each tab provides different information and features for analyzing the application's performance and behavior.


Overview tab




The Overview tab shows the basic information about the selected application, such as its name, PID, main class, arguments, JVM version, Java home, VM flags, system properties, environment variables, and classpath. You can also see the application's icon and display name if available.


The Overview tab also allows you to perform some actions on the application, such as taking a heap dump, taking a thread dump, or performing a garbage collection. You can also open the application's log file or launch a terminal session if supported by the platform.


Monitor tab




The Monitor tab shows the real-time graphs of the application's CPU usage, GC activity, heap and metaspace memory usage, classes loaded and unloaded, and threads started and terminated. You can also see the current values of these metrics in the table below the graphs.


The Monitor tab also allows you to configure the monitoring settings, such as the refresh interval, the time span of the graphs, and the units of measurement. You can also export the monitoring data to a CSV file or copy it to the clipboard.


Threads tab




The Threads tab shows the list of threads running in the application. You can see the thread name, state, CPU time, user time, and stack trace for each thread. You can also filter the threads by name or state using the search box.


The Threads tab also allows you to perform some actions on the threads, such as suspending or resuming them, interrupting them, or changing their priority. You can also take a thread dump of the application or compare two thread dumps to see the differences.


Sampler tab




The Sampler tab allows you to perform lightweight CPU and memory sampling on the application. Sampling is a technique that periodically collects information about the application's execution without instrumenting its code. It is less accurate but more efficient than profiling.


The Sampler tab shows the results of CPU and memory sampling in a tree table format. You can see the methods or classes that consume the most CPU time or memory allocations in the application. You can also drill down into the call tree or allocation tree to see more details.


The Sampler tab also allows you to configure the sampling settings, such as the sampling interval, the number of samples, and the filter criteria. You can also export the sampling results to a snapshot file or copy them to the clipboard.


Profiler tab




The Profiler tab allows you to perform full-fledged CPU and memory profiling on the application. Profiling is a technique that collects detailed information about the application's execution by instrumenting its code. It is more accurate but less efficient than sampling.


The Profiler tab shows the results of CPU and memory profiling in a tree table format. You can see the methods or classes that consume the most CPU time or memory allocations in the application. You can also drill down into the call tree or allocation tree to see more details.


The Profiler tab also allows you to configure the profiling settings, such as the profiling mode, the instrumentation filter, and the root methods. You can also export the profiling results to a snapshot file or copy them to the clipboard.


Heap Dump tab




The Heap Dump tab allows you to analyze the heap data of the application. A heap dump is a snapshot of the memory of a Java process at a given point in time. It contains information about the objects and classes in the heap, as well as their references and values.


The Heap Dump tab shows the summary of the heap dump, such as the total size, number of objects, number of classes, and GC roots. You can also see the histogram of the heap dump, which shows the distribution of objects and classes by size and count. You can also filter the histogram by name or size using the search box.


The Heap Dump tab also allows you to perform some actions on the heap dump, such as finding the biggest objects, finding objects by class or value, finding paths from GC roots, finding paths to GC roots, finding retained sizes, finding nearest GC root, or comparing two heap dumps. You can also export the heap dump to a file or copy it to the clipboard.


Snapshot tab




The Snapshot tab allows you to view and manage the snapshots of the application. A snapshot is a file that contains the results of monitoring, sampling, profiling, or heap dump analysis. It allows you to save and restore the state of the application for later examination.


The Snapshot tab shows the list of snapshots that have been taken or loaded for the selected application. You can see the name, type, size, date, and description of each snapshot. You can also filter the snapshots by name or type using the search box.


The Snapshot tab also allows you to perform some actions on the snapshots, such as opening them in a new tab, renaming them, deleting them, saving them to a file, loading them from a file, or comparing them with another snapshot. You can also export the snapshots to a CSV file or copy them to the clipboard.


How to use plugins and extensions




VisualVM provides a plugin system that allows you to extend its functionality with additional features. Plugins are modules that can be installed and uninstalled from VisualVM without affecting its core functionality. Extensions are standalone applications that can be launched from VisualVM and communicate with it via an API.


You can find and install plugins from the Tools menu in VisualVM. You can choose from a list of available plugins that are hosted on VisualVM's update center. You can also download plugins from other sources and install them manually using the Add Plugins button.


Some examples of plugins that you can use are:


  • : A plugin that shows detailed information about garbage collection activity in real time.



  • : A plugin that allows you to view and manipulate MBeans registered on a local or remote JVM.



  • : A plugin that allows you to trace various metrics of an application over time.



  • : A plugin that allows you to inject tracing code into a running Java application without restarting it.



  • : A plugin that launches JConsole from VisualVM and connects it to a local or remote JVM.



Some examples of extensions that you can use are:


  • : An extension that allows you to launch VisualVM from Eclipse IDE and automatically connect it to a running Java application.



  • : An extension that allows you to execute Object Query Language (OQL) queries on heap dumps.



  • : An extension that allows you to view log files generated by VisualVM or other applications.



Conclusion




VisualVM is a powerful tool that provides a visual interface for viewing detailed information about local and remote Java applications while they are running on a JVM. It integrates and utilizes some of the command-line tools that JDK provides, such as jmap, jstack, jConsole, jstat, and jinfo. It also supports lightweight profiling capabilities, such as CPU sampling, memory allocation tracking, heap dump analysis, thread dump analysis , and more. VisualVM can help you to track memory leaks, analyze heap data, monitor garbage collector and CPU activity, take snapshots, and troubleshoot performance issues.


In this article, we have shown you how to download and install VisualVM, how to run it and connect to local and remote applications, how to monitor and profile applications, and how to use plugins and extensions to enhance its functionality. We hope that you have found this article useful and informative. If you have any questions or feedback, please feel free to leave a comment below.


FAQs




What are the system requirements for VisualVM?




VisualVM requires a compatible JDK 8 or later to run. It also requires a minimum of 512 MB of RAM and 150 MB of disk space. It supports Windows, Linux, macOS, and Solaris platforms.


How can I update VisualVM to the latest version?




You can check for updates from the Tools menu in VisualVM. You can also download the latest version from the page on its official website and replace the existing installation with the new one.


How can I report a bug or request a feature for VisualVM?




You can report a bug or request a feature for VisualVM using the to discuss with other users and developers.


How can I contribute to VisualVM development?




You can contribute to VisualVM development by submitting pull requests, writing documentation, creating plugins, testing new releases, or providing feedback. You can find more information on how to contribute on the page on its official website.


Where can I find more resources about VisualVM?




You can find more resources about VisualVM on the following pages:


  • : The official documentation that covers all aspects of VisualVM usage and development.



  • : The wiki that contains various articles, tutorials, tips, and tricks about VisualVM.



  • : The blog that provides news, announcements, and insights about VisualVM.



  • : The YouTube channel that features videos and screencasts about VisualVM.



44f88ac181


1 view0 comments

Recent Posts

See All

Comments


bottom of page