JVM
Role of the JVM
It reads Java applications through the class loader and executes them together with the Java API
The JVM acts as an
intermediarybetween Java and the OSIt allows Java to be
reusableregardless of the OS
It performs the most important task: memory management, i.e.,
Garbage Collection
Java Program Execution Process
When a program is executed, the JVM
allocates memoryneeded by the program from the OSThe JVM divides this memory into several areas according to their purpose and manages them
The
Java compiler (javac)reads the Java source code (.java) and converts it into Java bytecode (.class)Class files are loaded into the JVM through the
Class loaderThe loaded class files are interpreted through the
Execution engineThe interpreted bytecode is placed in the
Runtime Data Areaswhere actual execution takes placeRuntime Data Areas: Memory space allocated from the OS to execute the program
During this process, the JVM performs management tasks such as Thread Synchronization and GC as needed
Last updated