Introduction to Jvm--java virtual machine memory structure

Source: Internet
Author: User

Java Virtual machine memory structure

Introduction Program counters for each region

A program counter that records the address of an instruction that each thread is executing. Each thread has a thread counter, so the zone is "thread-private" memory, with the same life cycle as the thread. If the thread is executing a native local method, the program counter is empty.

Virtual Machine Stack Area

Each time a thread executes a method, the virtual machine creates a stack frame in the region that stores information such as local variables, dynamic links, method exits, and so on. This zone is also a "thread-private" memory.

Local method Stack

The local method stack is primarily used to execute the native method service

Java heap

All threads share a zone that is created when the virtual machine is started. The only purpose of the zone is to save the object instance, and the virtual machine memory management is primarily a garbage collection (GC) of this area. For GC, the virtual machine divides the region into several sub-regions: The New Generation (Eden, from Survivor, to survivor), and the Laosheng generation.

Method area

Used to hold virtual machine load class information, constants, static variables, code data, and so on, this area is the usual meaning of the permanent generation. The run-time constant pool belongs to this method area, which holds various literal constants and symbolic references.

    

Introduction to Jvm--java virtual machine memory 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.