Java (JVM) Memory Types | Code Factory


Donate : Link

Medium Blog : Link

Applications : Link

Java Virtual Machine is a program/software which takes Java bytecode (.class files) and converts the byte code into machine understandable code.

JVM contains a module known as a class loader. A class loader in JVM loads, links and initialize a program.

1. Loads the class into the memory.
2. Verifies the byte code instructions.
3. Allocates memory for the program.

The memory in the JVM is divided into five different parts namely :

  1. Method area : The method area stores the class code, code of the variables and methods.
  2. Heap : The Java objects are created in this area.
  3. Java Stack : While running methods the results are stored in the stack memory.
  4. PC (Program Counter) Register : These contain the address of the instructions of the methods.
  5. Native method stacks : Similar to Java stack, native methods are executed on the Native method stacks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s