Java (JVM) Memory Types



Java Virtual Machine is a program/software which takes Java bytecode (.class files)

and converts the byte code (line by line) into machine understandable code.

JVM contains a module known as a class loader. A class loader in JVM loads, links and, initializes a program. Itβˆ’

  • Loads the class into the memory. 
  • Verifies the byte code instructions.
  • Allocates memory for the program.

The memory in the JVM is divided into five different parts namelyβˆ’ Method areaβˆ’ The method area stores the class code βˆ’ code of the variables and methods. 

Heap βˆ’ The Java objects are created in this area. 

Java Stackβˆ’ While running methods the results are stored in the stack memory. PC registersβˆ’ These contain the address of the instructions of the methods. 

Native method stacksβˆ’ Similar to Java stack, native methods are executed on the Native method stacks.

Updated on: 2020-06-18T07:14:20+05:30

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements