Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java Virtual Machine (Class Loader (Application - Loads application level…
Java Virtual Machine
Class Loader
-
-
Bootstrap - Loads major Java internal classes. Is stored by the JVM as machine code, as it is needed to start the class loading process
The JVM will check if a class needs to be loaded. If it does, JVM will ask the ClassLoader sub-system to load that class. This goes up the chain from Application to Bootstrap. Bootstrap will try to load the class, then Extension, then Application. If Application fails, ClassNotFoundException is thrown.
A class loaded by the Extension CL is only able to see classes loaded by Extension or above. So, if class A is loaded by Application and B by Extension, class A can access B but B cannot see A.
The ClassLoader java class executes this functionality. It has methods for finding loading and defining classes.
Constant Pool
CP Resolution - At runtime, when a symbolic reference is used, it must be resolved which is the process of using the link to find the entity and replacing the link with a direct reference.
Runtime CP - When a class file is loaded by the JVM, an internal version. This simply maps to the CP.
Class File CP - When java classes are compiled, it creates symbolic links between the other classes that are referenced which are stored in the CP. Each class file has it's own CP.
Entries are stored in the CP in a similar way to arrays. When a piece of java byte code wants to use an entry from the CP, it will specify the index
CP Patching - This will overwrite a value in the CP with another value (eg. changing the data). This can be done at runtime to change method signatures and data within a class
Memory
Class method area - Contains compiled code of a class, including methods and variable calls.
-
-
-
JIT Complier
In the runtime of a program, the JIT compiler will convert byte code into machine code, just before it is needed.
-