Java Exceptions counter on JVM HotSpot

I believe there are free tools to do it, but even making your own tool is easy. JVMTI will help. Here is a simple JVMTI agent I made to trace all exceptions: #include <jni.h> #include <jvmti.h> #include <string.h> #include <stdio.h> void JNICALL ExceptionCallback(jvmtiEnv* jvmti, JNIEnv* env, jthread thread, jmethodID method, jlocation location, jobject exception, jmethodID … Read more

JVM heap parameters

The JVM will start with memory useage at the initial heap level. If the maxheap is higher, it will grow to the maxheap size as memory requirements exceed it’s current memory. So, -Xms512m -Xmx512m JVM starts with 512 M, never resizes. -Xms64m -Xmx512m JVM starts with 64M, grows (up to max ceiling of 512) if … Read more

What does -XX:MaxPermSize do?

The permanent space is where the classes, methods, internalized strings, and similar objects used by the VM are stored and never deallocated (hence the name). This Oracle article succinctly presents the working and parameterization of the HotSpot GC and advises you to augment this space if you load many classes (this is typically the case … Read more