How to intercept object creation in Java lower than user class level

Java Objects can be created in several different ways. From Java code, when a Java method, either interpreted or compiled, executes one of the following bytecode instructions: new, newarray, anewarray, multianewarray. From native code, when native methods, including those in standard class library, call one of JNI functions: NewObject, NewObjectArray, NewStringUTF, NewDirectByteBuffer, etc. Directly from … Read more

Why is the 64bit JVM faster than the 32bit one?

From: http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#64bit_performance “Generally, the benefits of being able to address larger amounts of memory come with a small performance loss in 64-bit VMs versus running the same application on a 32-bit VM. This is due to the fact that every native pointer in the system takes up 8 bytes instead of 4. The loading of … Read more

Measuring time spent on GC

I guess that when GC (Garbage Collector) is working the application stops and resumes when GC finishes I don’t think that is a safe assumption. Are you sure the garbage collector is not working in parallel with your application code? To measure the time spent in collecting garbage you can query the Garbage Collector MXBean. … Read more