Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Explain Java JVM Run Time Data Areas


Published on

It is very important to understand Java programming but for that Java Virtual Machine, runtime data areas are needed to understand as a prerequisite. OutOfMemoryError is one of the most dreaded errors in Java and is associated with Java Virtual Machine (JVM) memory areas.

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Explain Java JVM Run Time Data Areas

  1. 1. Explain Java JVM Run Time Data Areas
  2. 2. 1) Program Counter (PC) Register : The program counter (PC) helps in recording the current instruction execution at any moment. In a sequence of instructions in a program, it is called as a pointer to the current instruction. It is the same in Java JVM terms. As Java assists multithreading, the architecture is multithreaded and thus when a thread is created a program counter is created. The current statement executed in the thread is executed by the PC counter. Ream More : Multithreading in Java Stay Connected With CRB TECH
  3. 3. 2. Heap Memory : For storing objects of arrays and classes, heap data area is used. Across multiple threads, heap memory is common and shared. Garbage collector comes to the rescue over here. At VM startup heap data area is created. This helps in claiming the memory back by the garbage collector. It is regarded as the best feature of Java. Read More : Garbage Collectors In Java and It’s Types Stay Connected With CRB TECH
  4. 4. 3. Method Area : There is a logical part of heap area called method area but JVM implementers decide about it. There are per class structures and fields in the method class. It consists of method data, method and constructor code, run-time constant pool. At JVM startup, a method is created and shared among other threads. If the memory space is not enough during the run-time then JVM will throw OutofMemoryError. Stay Connected With CRB TECH
  5. 5. 4. Run-time Constant Pool : Outside of the method area, a run-time constant pool is created and it is done by JVM when an interface or class is created. The constant pool table has the Run-time constant pool which is the best suited for a single class or interface. If the JVM cannot find the memory for run-time constant pool allocation it will throw OutOfMemoryError. Read More : Understanding JVM Internal
  6. 6. THANK YOU