Category: Performance

How much actual memory does an array consume 0

How much actual memory does an array consume

Memory usage of a single-dimension array A single-dimension array is a single object. As expected, the array has the usual object header. However, this object head is 12 bytes to accommodate a four-byte array...

How much actual memory does an object occupy 0

How much actual memory does an object occupy

Instances of an object on the Java heap don’t just take up memory for their actual fields. Inevitably, they also require some “housekeeping” information, such as recording an object’s class, ID and status flags...

When does JIT inline methods 0

When does JIT inline methods

The Hotspot JIT only inlines methods that are less than a certain (configurable) size. So using smaller methods allows more inlining, which is good. When running this code with the following JVM flags: -XX:+UnlockDiagnosticVMOptions...

Why does JIT not compile huge methods 0

Why does JIT not compile huge methods

I was wondering why the JVM’s JIT compiler ignores “huge methods” from compilation. (Unless the DontCompileHugeMethods flag is set to false) So here is the answer : Basically the ROI of compiling huge methods...