Java--Virtual machines and memory

Source: Internet
Author: User

From the general direction to divide:
Stack memory, heap memory, method area, local method stack, program counter

Java is divided from the point of view of storing data:

Register: The fastest storage area, allocated by the compiler on demand, is not considered controlled.

Stack (STATCK): holds the base data type and the reference alias

Heap (Heep): New comes out of something

Static storage: Static members are stored statically defined

Constant storage: (Constant storage): Holds string constants and basic type constants (final)

Non-RAM Storage

For strings: References to objects are stored in the stack if they have been created at compile time and stored in a constant pool if the runtime (new) is determined to be stored in the heap.

For strings equal to equals (string values equal), there is always only one copy in the constant pool, which can have multiple copies in the heap.

Java--Virtual machines and memory

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.