Science and technology

Monitor your Java on Linux with jconsole

The Java Development Kit (JDK) gives binaries, instruments, and compilers for the event of Java functions. One useful software included is jconsole.

To exhibit, I’ll use the WildFly J2EE utility server, which is a part of the JBOSS open supply utility server venture. First, I begin up a standalone occasion.

~/wildfly/24.zero.1/bin$ ./standalone.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /residence/alan/wildfly/24.zero.1

  JAVA: /usr/lib/jvm/java-11-openjdk-11.zero.11.zero.9-5.fc34.x86_64/bin/java

Now, in one other terminal, I kind jconsole.

$ jconsole

Upon launching, jconsole lists native cases. Select Local Process, then choose the title of the method and click on Connect. That is all it takes to attach and start utilizing jconsole with a operating Java Virtual Machine (JVM).

Overview

The Java Monitoring and Management Console exhibits the method identifier (PID) on the prime of the dashboard. The Overview tab has 4 graphs to indicate the vitals for Heap Memory Usage, Threads, Classes, and CPU Usage.

The tabs alongside the highest present extra detailed views of every space.

Memory

The Memory tab shows graphs of assorted elements of the reminiscence being utilized by the JVM. The quantity of the server system reminiscence allotted to the JVM is known as the heap. This display screen additionally gives particulars about utilization by the interior parts of the heap, such because the Eden Space, Old Gen, and the Survivor Space. You can manually request a rubbish assortment motion as nicely.

Threads

The Threads tab exhibits what number of threads are operating. You may also manually test for deadlocks.

Classes

The lessons tab tells you what number of lessons are loaded and what number of have been unloaded.

VM Summary

The VM Summary tab gives many particulars concerning the utility and the host system. You can study which working system and structure you might be on, the entire quantity of system reminiscence, the variety of CPUs, and even swap area.

Further particulars concerning the JVM proven within the abstract embody present and most heap measurement and details about the rubbish collectors in use. The backside pane lists all the arguments handed to the JVM.

MBeans

The final tab, MBeans, enables you to drill down via all the MBeans to view attributes and values for every.

Conclusion

Java has been round a very long time, and it continues to energy hundreds of thousands of techniques worldwide. Plenty of growth environments and monitoring techniques can be found, however having a software like jconsole included within the base equipment will be extremely worthwhile.

Most Popular

To Top