Uttar Pradesh, India
Instagram
image

Important Memory Areas Of JVM

The important memory areas of JVM that are defined at runtime of program executions are summarized below


1-Heap Area


The java objects(referenced variables) are stored in heap area of JVM.For example :Java classes and Arrays are stored in heap area.

2-Method Area


JVM uses method area to stores field's and method's level information per class level.

3-JVM Stack Area


Threads are stored in stack area of JVM.A Java Virtual Machine stack stores frames which is used to store data and partial results, as well as to perform dynamic linking, return values for methods, and dispatch exceptions.A new frame is created each time a method is invoked.A frame is destroyed when its method invocation completes, whether that completion is normal or abnormal (it throws an uncaught exception or any exceptional statement).

4-Native Method Stacks 


The JVM stores native methods in native method stacks area which is not written in java language(other language methods implementations are stored into native stacks area).The size of stacks can be fixed and dynamic type.The exceptional conditions are associated with Java Virtual Machine stacks are two main exceptions StackOverflowError and OutOfMemoryError.

5-PC Registers


JVM threads has its own program counter registers to run each thread separately.The PC Registers functions working differently for native or non native stacks.If the method currently execured by thread is non native pc register contains the address of that method and if the current method executed by thread is native the value become undefined in pc register.
 


Comments

Share your thoughts in the comments

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