coding180 icon
Coding180

How many memory regions are allocated by the JVM?

Home > Interviews > Java


robort - 2022-08-30 10:49:40

The JVM allocates memory regions of the following types:

  • Class (method) area: The class (method) area stores the structure of each class, including the runtime constant pool, fields, method data, and method code.
  • Heap: This is the runtime data area where objects are allocated memory.
  • Stack: The Java Stack is where frames are kept. It contains local variables and partial results, and it participates in method calls and returns. Each thread has its own JVM stack, which is created at the same time as the thread. Each time the method is called, a new frame is created. When a method call completes, the frame is destroyed.
  • Program Counter Register: The PC (Program Counter) register contains the address of the currently executing Java Virtual Machine instruction.
  • Native Method Stack: It contains all the native methods used in the application.

user

Robort Gabriel

Lagos, Nigeria

Freelance Web Developer, Native Android Developer, and Coding Tutor.

Skills
  • UI / UX
  • JavaScript
  • Python
  • PHP
  • Kotlin
  • Java
  • Bootrap
  • Android
  • Laravel