Oracle HotSpot Virtual Machine Garbage Collection tuning guide
JVM internals JVM JVM jit jbma jcf Different section of JVM [Eden/Serviver/Tenured + PermGen/CodeCache] Heap
JIT compiler in JVM Heap jitop
VM option (-XX:+PrintCompilation) will print all JIT optimizations at runtime
VM option (-X) will print all Non-standard JVM options
Output format: {compile_id}{method_attributes} {short_name} ({size} bytes)
HotSpot JVM Runtime, OpenJDK8 Compiler/JVM source jco
HotSpot JVM Glossary HeapStats, a lightweight monitoring tool for Java heap and GC.
Winner of JavaOne Duke’s Choice Awards Method area is a subset of PermGen area ma jma
Compilation guide and source
Automatic 'java.lang' package loading (line 521 call to 'importAll' method)
JIT compiler and CodeCache in brief om1
VM option (-Xint) will run JVM in interpreter mode only; No JIT
Example program to see how -Xint can affect performance JIT compiler dynamic De-Optimization
If an optimization did not, improve performance and undo that optimization
Class Loading in JVM hjc cl
Class Linking in JVM: Verification, Preparation, Resolution (VPR) of Symbolic References
Symbolic References are used to retrieve the actual object
Verification can be turned off by supplying the -noverify option cv cpri
Class Execution in JVM jvma jvma1
Class Format in JVM co Class file uses Hexadecimal format JDK class disassembler: javap -v -p -s -sysinfo com.test
First put your jar in classpath(export CLASSPATH=your-jar.jar) st
Java bytecode instruction set
Java bytecode 'invoke' type instructions (VISSD) inv inv
  • invokevirtual for class methods using dynamic dispatch
  • invokeinterface for interface methods
  • invokestatic for class methods
  • invokespecial for constructor/private methods/super calls
  • invokedynamic (indy) for Lambdas
How Lambdas uses invokedynamic (indy)
JVM OutOfMemory Error and thread Dump Analysis using Eclipse MAT How JVM stores static/class references Interned String and Garbage Collection
Difference of Metaspace and PermGen MS
HotSpot VM Options(BGPD): jca Standard(-), Non-standard(-X), Developer (-XX) -XX:+PrintFlagsFinal lists all flags available in VM
Garbage Collection(SPCG): Garbage Collections Garbage Collections Garbage Collections Garbage Collection Garbage Collections
Java G1 Garbage Collector (-XX:+UseG1GC) g1gc Concurrent Mark Sweep (-XX:+UseConcMarkSweepGC)
JVM Microbenchmarking
"About 97% of the time: Premature optimization is the root of all evil" - Donald Knuth
Class Loader Architecture Class Loader Program Counter Native instruction using JNI ma CPU x86 registers Decimal, Hexadecimal, Octal, Binary conversion table Load all associated class info a running class (java -verbose)
How Java objects/primitives stored in memory using visualvm IEEE 754
Why 'long' consumes more than 8 bytes in memory: Memory Padding
Why 'byte' consumes 4 bytes in memory joim
Garbage Collection tuning for Interned Strings
Java Compressed Strings VM option (-XX:+UseCompressedStrings) is discarded in JDK7
JVM optimization using hoisting by JIT
Maximum number of threads per JVM and (-XX:ThreadStackSize) VM option Why does the JVM still not support tail-call optimization
Understanding sun.misc.Unsafe for 'C' like direct memory access in JVM
An introduction to JVM performance by Rafael Winterhalter Minor GC vs Major GC vs Full GC