jvm--class execution mechanism and JVM memory composition structure

Source: Internet
Author: User

class execution mechanism
    • The JVM executes class bytecode based on the stack architecture, and after the thread is created, the program counter (PC) and stack (stack) are generated.
    • The PC holds the offset of the next executed instruction within the method, the stack holds a stack frame, each stack frame corresponds to each call of each method, and the stack frame holds local variables and the operand stack

The structure of the stack is as follows:

JVM Memory Structure

The Java Virtual machine specification for Java Virtual machine memory is actually the Java Virtual Runtime data area, its schema is as follows:

    • Heap

  All the memory of objects created by new is allocated in the heap;

    • Stack

Each thread executes each method by applying a stack frame in the stack, each of which includes the local variable area and the operand stack.

Used to hold temporary variables, parameters, and intermediate results during this method call

    • Method Area

Store information such as class information, static variables, final type constants, properties, and methods, and the method area is also known as the Permanent Generation (Permanent Generation)

    • Local method Stack

The local method stack is the operating system local method service that is called for the virtual machine, storing the state of each native method call

jvm--class execution mechanism and JVM memory composition structure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.