Posts

Showing posts from October, 2022

Deep Thoughts On JVM (Java Virtual Machine)

Image
Java Virtual Machine (JVM) JVM(Java Virtual Machine) acts as a run-time engine to run Java applications. JVM is the one that actually calls the main method present in a java code. JVM is a part of JRE. JVM is specifically responsible for converting bytecode to machine-specific code and is necessary in both JDK and JRE. It is also platform-dependent and performs many functions, including memory management and security. JVM Architecture It is mainly responsible for three activities.  Loading Linking Initialization Loading The Class loader reads the “.class” file, generate the corresponding binary data and save it in the method area. For each “.class” file, JVM stores the following information in the method area. Linking Performs verification, preparation, and (optionally) resolution.  Verification: It ensures the correctness of the .class file i.e. it checks whether this file is properly formatted and generated by a valid compiler or not.  Preparation: JVM allocates memory ...