Jvm Internals

1. JVM Structure

2. Class Loader SubSystem

  • Loading: finding and importing the binary data for a type
  • Linking: performing verification, preparation, and (optionally) resolution
    1. Verification: ensuring the correctness of the imported type
    2. Preparation: allocating memory for class variables and initializing the memory to default values
    3. Resolution: transforming symbolic references from the type into direct references.
  • Initialization: invoking Java code that initializes class variables to their proper starting values.

Parent-Delegation Model

  • Bootstrap Class Loader: $JAVA_HOME/jre/lib/rt.jar, controlled by -Xbootclasspath option
  • Extension Class Loader: %JAVA_HOME/jre/lib/ext/*.jar, controlled by -Djava.ext.dirs system property
  • Application/System Class Loader: $CLASSPATH, controlled by -classpath/-cp/$CLASSPATH
  • User defined classloader: custom classpath [path on disk, a network address etc]

Read More