Wisdom Podcast Video Notes (i) Partitioning of memory

Source: Internet
Author: User

When a Java program runs, it needs to allocate space in memory. In order to improve the efficiency of computing, the space is divided into different regions, because each region has a specific processing data and memory management mode

1, Stack memory

For storing local variables, the occupied space is automatically freed when the data is used.

When the main function runs, it will open up space in the stack, place global variables, etc.

When the main function calls another function, the local variable of the function is also in the stack

2, Heap memory

Arrays and objects, which are stored in heap memory by the instance created by new

Each entity has a memory address value

The variables in the entity have default initialization values

Entities are no longer being used and are reclaimed by the garbage collector for an indeterminate period of time

3, method area, local method area, register (these three kinds later)

Wisdom Podcast Video Notes (i) Partitioning of 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.