- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Virtual Machine (JVM) Stack Area
85 Lectures 6 hours
Following are some key points to undertstand JVM Stack Area −
During the creation of a thread, the Java Virtual Machine creates a separate stack.
The JVM performs only two operations upon this stack. The operations are push (i.e insert) and pop (i.e delete).
When a thread is currently in execution, the stack associated with it is known as runtime stack.
Every method call done by the thread, intermediate calculations, assignment of local variables, calling parameters etc, are stored as an operation in the runtime stack.
Once the thread stops or completes executing, the respective part from the stack is deleted.
Once all the calls by the thread are complete, the stack becomes empty, and is deleted.
Just before terminating the thread, JVM destructs the stack associated with the thread.
The stack that stores data associated with a thread is exclusively available only to that specific thread, and unaccessible to other threads.
This indicates that the data in the stack is thread-safe.
Every data in the stack associated with the thread is known as activation record or stack frame.
Note − It is not compulsory for JVM stack to have contiguous memory locations.
The structure of the activation record/stack frame
It consists of three constituents −
Local variable array,
Operand stack, and
The JVM creates a stack frame of the required size by examining the class data.
The Operand Stack functions like a workspace to the JVM- it is used to store intermediate computational results. It is structured like a variable array locally, but can be accessed by performing push and pop operations on the stack.
Frame data − It contains constant data values and method returned data. In addition to this, it contains a reference to the Exception table that has all the information about catch block when exceptions need to be caught and relevant messages need to be shown on the console.
- What is Java Virtual Machine (JVM)?
- What is JVM, Java virtual machine?
- Explain Java Virtual Machine (JVM) Architecture
- Explain Java Virtual Machine's Internal Architecture
- Display the amount of free memory in the Java Virtual Machine
- Explain Turing Machine variant Two Stack PDA?
- How is Docker different from a Virtual Machine?
- How to change/increase the heap size of the Java Virtual Machine in Java?
- Java (JVM) Memory Types
- Java (JVM) memory model
- Verification in Java (JVM)
- How to Create/Add a New Virtual Disk for an Existing Linux Virtual Machine
- JVM shutdown hook in Java
- Why Java programs running on Android systems do not use the standard Java API and virtual machine?
- JVM Stacks