The difference between a Java stack and a heap

Source: Internet
Author: User

One, Stack space

1, stack space storage data efficiency is high

2. The data in the stack is managed according to the "advanced post-out" method

3, stack space storage space is relatively small, can not store large amounts of data

4. The JVM stores basic types of data in the stack space

Help understand

1, "Inn" can provide a lot of high quality and efficient service [high efficiency]

2, "Inn" outside the guests want to stay a lot of | | Assuming that guests advance to the priority of staying in the top floor [advanced], and the top floor to go out is also the slowest [post-out].

3, "Inn" charges more expensive, so can not provide a large number of room occupancy [storage space is small].

4, the basic type of data-"The Inn" VIP, you can first stay

Second, the heap space

1. The lowest efficiency of heap space access data

2, the location of data storage random allocation

3, heap space storage data space is large, can store large-capacity data

Help understand

1, "haystack" in search for the seeds, to find a long [inefficient]

2, "haystack" in the seeds are casually placed [location randomly assigned]

3, "Haystack" beside can put a lot of seeds, casually come ah, haha [storage space large]

The difference between a Java stack and a heap

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.