Java Memory Partitioning

Source: Internet
Author: User

Java can be widely used, it is very important that the GC (garbage Collection, garbage collection) mechanism, Java and C + + is one of the main differences. The benefit of the GC mechanism is that we do not need to focus too much on the oom caused by memory leaks, but this does not mean that there is no memory leak in Java development, and in some cases the GC can also affect the efficiency of the program, which in extreme cases causes "the whole world to be still."

Java GC, designed to memory management. The memory area of Java

1. Procedure counter (program Counter Register) area

This area is relatively small and records where the current Java thread bytecode is executed. It is a thread-private (a thread that associates a program counter).

2. Virtual machine stack (JVM stack) zone

Advanced out of the data area, store Java local variables, operands, method exports, etc., is also thread-private

3. Local methods Stack (Native method Stack) area

That is, the stack used to execute the local code, the thread private

4. Heap Area

The most important area of Java GC, where Java object instance data is generated and destroyed, belongs to all threads

5. Method area

Used to store the class information that has been loaded by the virtual machine (that is, the information that needs to be loaded when the class is loaded, including the version, field, method, interface, and so on), the final constant, the static variable, the compiler's immediately compiled code, and so on. belongs to all threads

Java Memory Partitioning

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.