Java Program Memory usage

Source: Internet
Author: User

One, memory use

Second, Java Runtime data regions

1. Program Counter:

The line number prompt for the byte code executed by the current thread.

2. Java Virtual machine stack:

Thread private, the same as the thread life cycle, save the base data type, if the thread requested a stack depth greater than the virtual machine allowed depth, will throw stackoverflowerror, if the extension can not request enough memory will throw OutOfMemoryError.

3. Local method Stack:

Similar to the role of the virtual machine stack, it is a native method service for virtual machines, and throws Stackoverflowerror and OutOfMemoryError exceptions

4. Java heap:

It is an area shared by each thread that holds an instance of the object. Java heap is the main area of Java Memory Manager (GC) management

5. Method Area:

Areas shared by each thread for storage: class information, constants, static variables, compiled code, and so on.

6, the operation of constant-rate pool:

Part of the method area

Java Program Memory usage

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.