Distinguish the difference between heap and stack area and heap and stack


JVM memory division has five: registers, local area method, area method, stack memory, heap memory

Heap memory model and stack area belongs, it belongs to the stack and heap data structures.

Stack area (stack): The compiler automatically assigns release, fast, store local variables, variable life cycle ends automatically released;

Heap (heap): generally released by the programmer distribution, slow, storage arrays and objects, the end of the life cycle of an object requires garbage collection mechanism.

Stack: An operation is constrained linear form, which allows only limit is the only insertion and deletion operations at one end of the table

Heap: is a common tree structure, a special complete binary tree

Guess you like

Origin www.cnblogs.com/BruceV/p/11887088.html