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