To execute any program the JVM makes use of following memory area:-
2.Static Pool Area
- The Heap Area is used to store the instance in the program.
In the heap area the memory allocated is random.
- The new operator loads the non-static member into heap area.
2.Static Pool Area:
- This area is used for storing the static member of the class .
- The pool will be created for each class;
- The class loader program of JVM is responsible to load the static
member of the class to the static position.
- The method area is used to store the definition statements of methods.
- The stack area is used for execution purpose and normal statements to which
have to be executed in JVM should be come to stack area.
- The local variable components always store in stack memory area.
Memory allocation for block:
When you define any block it always go through stack as like local variable.