Data partitions of Java virtual machines

Source: Internet
Author: User

Data partitions of Java virtual machines

 

Image.png

Purpose: The row number indicator of the bytecode executed by the current thread.
In the virtual machine conceptual model, when the bytecode interpreter is working, it selects the next bytecode instruction to be executed by changing the counter value, this counter is required for basic functions such as branch, loop, jump, exception handling, and thread recovery.
Note: If the thread is executing a java method, the counter records the address of the Virtual Machine bytecode instruction being executed. If the Native method is being executed, the counter value is empty. This memory region is the only region that does not define any OutOfMemoryError conditions in the Java Virtual Machine specification.

  1. Java Virtual Machine Stack

The life cycle is the same as the thread. It describes the Memory Model for Java method execution: when each method is executed, a stack frame is created to store information such as the local variable table, Operation stack, dynamic link, and method exit. Each method is called until the execution is complete. It corresponds to the process from the inbound stack to the outbound stack of a stack frame in the VM stack.
In the Java Virtual Machine specification, this region specifies two exception conditions: If the stack depth requested by the thread is greater than the depth allowed by the virtual machine, an StackOverflowError exception will be thrown; if the Virtual Machine stack can be dynamically expanded, an OutOfMemoryError error is thrown when the extended memory cannot be applied.

  1. Local method Stack

The role of the Virtual Machine stack is very similar. The difference is that the virtual machine stack executes Java method services for the virtual machine, and the local method stack is the Native method service used by the virtual machine.
The exception is thrown in the same way.

  1. Heap

    The largest part of memory managed by the Java Virtual Machine. Created when the VM is started, the only purpose of this memory area is to store the object instance.
    Heap is the main area of the garbage collector management. From the perspective of memory collection, because the collectors currently basically use the generational collection algorithm, the Java heap can also be subdivided: the new generation and the old generation, the Eden space, the From Region vor space, and the To region vor space.
    Java heap can be in physically discontinuous memory space, as long as it is logically continuous.

  2. Method Area

Stores information about classes loaded by virtual machines, constants, static variables, Code Compiled by the real-time compiler, and other data.
Off-topic: pool of runtime durations
A part of the method area is used to store various literal quantities and symbolic references generated during the compilation period. This part of content will be stored in the Method Area runtime pool after the class is loaded.

Minimum heap value-Xms
Maximum-Xmx
MaxPermSize
Method area size parameter-XX: PermSize
-XX: MaxPermSize

The direct memory capacity of the local machine can be specified through-XX: MaxDirectMemorySize. If not specified, the default value is the same as the maximum value of the Java heap (-Xmx.

Join the study exchange group 569772982 to learn and exchange.

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.