Deep understanding of Java Virtual Machine--java memory area and memory overflow exception (i)

Source: Internet
Author: User

java VM full Name: Java Virtual machine;    
Java Virtual machine divides the memory it manages into several different data regions during the execution of a Java program. These areas have their own uses, as well as the creation and destruction times. The memory managed by the Java Virtual Machine includes the following runtime data regions:
1) program counters: A line number indicator that can be thought of as the byte code of the current thread's line. The bytecode interpreter selects the next byte-code instruction that needs to be executed by changing the value of the counter. The multithreading of a Java Virtual machine is implemented in a way that threads rotate and allocate processor execution time. At any given moment, a processor executes only the instructions in one thread. Therefore, each thread requires a separate program counter.
2) Java virtual stack: As with program counters, it is also thread-private. The life cycle is the same as the thread.
3) Local method stack: the native method service that is used for the virtual machine.
4) Java heap: 10 times times the Java heap is a chunk of memory shared by threads, created when the virtual machine is started. This memory area is used to hold object instances. The Java heap is the primary area of garbage collector management.
5) Method area: The same area shared by all threads, used to store data that has been loaded by the virtual machine.
6) Run a constant pool: is part of the method area. Used to hold various literal and symbolic references generated during the compilation period.
7) Direct Memory:

Virtual opportunity to a new directive, first checks whether the parameter of this directive can be positioned in a constant pool for a symbolic reference of a class, and checks whether the class represented by the symbol reference has been loaded, parsed, and initialized. If not, you must first perform the appropriate class loading process. (P45)

Deep understanding of Java Virtual Machine--java memory area and memory overflow exception (i)

Related Article

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.