The Java Virtual Machine isn’t uncompleted and, as with many applications related to or relying upon Java, can use some expert management and monitoring. Read below for some insights into the Java VM.
1. When it comes to JVM management and monitoring, understand that the JVM has instrumentation built in that will let you manage/monitor it using JMX technology, often mentioned as out-of-the-box management tools. Java VM has platform MBean and MXBeans servers to help you in your monitoring/managing. You can use these platforms to manage JMX-conforming applications.
2. As for Java memory leak detection within the VM, each platform MXBean captures a portion of JVM tasks such as garbage collecting, the class-loading system, the JIT compilation system, leak detection, and more, so that you can monitor different functions of the VM.
3. Because of the management/monitoring functions that execute the JMX technology, you’ll be able to watch it (the out-of-the-box portion) if you launch a Java app and employ JConsole. Do so and you won’t have to write any JMX API code. None!
4. When it comes to Java leak detection as it pertains to memory, remember that Java memory is controlled mostly by two strictures that are passed to the JVM when it starts: Xms and Xmx.
a. Xms is the size of contiguous memory that’s allocated to the JVM as soon as it’s started. Check to see if the value is 512m; if it is, the JVM will start up at once and will assign 512 megabytes of memory – even if it doesn’t need it.
b. Xmx is the size of memory that the JVM can grow to. Should the value be 1024m, the greatest amount of memory that will be made available to the JVM is 1000m.
5. Java applications, including JVM, use memory objects and subsequently let them go when any application process ends. Although the Java app will release the object, the Java VM won’t be able to access the memory until a garbage collection activity is completed; Java does this as a matter of course, but on a memory requirement basis.
6. Garbage collection is an intensive process and it’s not atypical to see processor utilization spikes while any Java program is executing. Still, these spikes tend to be short in length (they’re typically shorter than a second). These spikes tend to go unnoticed by users.
7. Any Java VM management as it relates to WebSphere application server monitoring should provide users with the ability to see heap usage, the use of key memory pools, garbage collection, as well as any stack traces thrown when user requests or other business transactions fail or timeout.
About the Author:
AppDynamics is the leading provider of application performance management for modern application architectures. That means not just the kinds of old-school app environments that existed 5 years ago, but the new ones: distributed, agile, and extremely hard to manage. They’re sometimes in the cloud, sometimes in the physical data center—and always causing headaches for ops and dev teams.