Java Memory management

JVM Memory

To execute any program the JVM makes use of following memory area:-
1.Heap Area
2.Static Pool Area
3.Method Area
4.Stack Area

1.Heap 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.

3.Method Area

  •  The method area is used to store the definition statements of methods.

4.Stack Area

  • 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.

Leave a Reply

Your email address will not be published. Required fields are marked *