Oct 5, 2013

Internal working of JVM(Java Virtual Machine)

Internal working of Java Virtual Machine(JVM) in java Programming

Java:Internal Working of JVM(Java Virtual Machine). Let us describe what is the internal working of Java Virtual Machine(JVM) in java-programming. I am describing here what happens internally in the JVM when a java-program is executed. Working of Java Virtual Machine is described below-

Working of Java Virtual Machine(JVM):-
  1. To load .class file from hard disk to RAM by the Class Loader Subsystem and stored into method memory area only once.
  2. To allocate the memory for all the static member of the specified class.
  3. If in specified class there is a static variable without initialized then JVM sets the default value of corresponding data type.
  4. If a class contains static blocks, then they executes in top to bottom order.
  5. Now control moves to the main method.
Above five steps defines the internal working of JVM(Java Virtual Machine) when a java-program is executed.