Java Object Storage Management

Source: Internet
Author: User

Storage allocations for Java programs in memory:

Heap Area:
1. All objects are stored, each containing a class-corresponding information. (The purpose of class is to get operation instructions)
2.JVM only one heap area (heap) is shared by all threads, and the heap does not hold basic types and object references, only the object itself
Stack area:
1. Each thread contains a stack where only objects of the underlying data type are saved and references to custom objects (not objects), objects are stored in the heap area
2. The data in each stack (original type and object reference) is private and other stacks are inaccessible.
3. The stack is divided into 3 parts: the basic type variable area, the execution environment context, the operation instruction area (holds the operation instruction).
Method Area:
1. Also called the static zone, like the heap, is shared by all threads. The method area contains all class and static variables.
2. The method area contains elements that are always unique throughout the program, such as the class,static variable.

Java Object Storage Management

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.