Java Virtual machine

Source: Internet
Author: User

What is a 1.java virtual machine

    1. Abstract specification
    2. A concrete implementation
    3. A running instance of a virtual machine

The life cycle of a 2.java virtual machine

When a Java program is started, a virtual machine instance is born, and when all non-daemon threads in the program terminate, the virtual machine instance exits

3.java Architecture of virtual machines

4. Data type

5. Word length

The most basic unit of data in a virtual machine is a word, and a two-character unit must hold a long or double-type value

6. Class Loader Subsystem

User-defined classes need to be derived from the Java.lang.ClassLoader class, and each loaded type is created with a Java.lang.Class instance

Four important methods in ClassLoader:

7. Method area

Also stores:

    1. Constant pool
    2. Field information
    3. Method information
    4. Class static variables
    5. A reference to the ClassLoader
    6. A reference to a class instance: A method in class that obtains the class's way: Class.forName (String className); object's GetClass () method

    7. Method table

8. Heap

Two ways to design a heap space:

The first object is easy to move, but requires two pointer passes, and the second requires only one pointer, but moving the object requires updating the reference to the object in the entire runtime data area

Method table:

In addition, the heap is also responsible for storing object locks, waiting for the collection

The representation of the array on the heap:

9. Program counter

10. Stack

The stack frame consists of three parts:

    1. Local variable area: the corresponding parameter and local variable of the method
    2. Operand stacks

    3. Frame data area: Support constant pool parsing, normal method return, abnormal dispatch data

The way the stack is grown:

Java Virtual machine

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.