1.

How many types of memory areas are allocated by Java Virtual Machine in Java?

Answer»

The following are the several types of memory areas allocated by the Java Virtual MACHINE:

  • CLASS(Method) Area: The Class(Method) Area keeps TRACK of per-class structures such as the runtime constant pool, fields, method data, and method code.
  • Program Counter (PC) Register: The PC (program counter) register stores the address of the Java virtual machine instruction currently being executed.
  • Stack: Frames are kept in the Java Stack. LOCAL variables and partial results, as well as invoking and returning methods, are all managed by it. Each thread has its own JVM stack, which is created at the same time as the thread. A new frame is created each time a method is called. When the method invocation of a frame is complete, it is destroyed.
  • Native Method Stack: The Native Method Stack CONTAINS every single native method utilised in the application.
  • Heap: This is where the objects' memory is allocated during runtime.


Discussion

No Comment Found