Java: Memory (Heap vs Stack)

Ben Cheng
Developer Notes
Published in
Dec 22, 2021

Heap Memory

Heap Memory is used for dynamic memory allocation of Java Objects.

Stack Memory

Stack Memory used for static memory allocation and execution of a single thread. It store local primitive value and reference to objects in heap.

Reference

--

--

Ben Cheng
Developer Notes

A developer in Hong Kong. Learning and rethinking as a developer. Welcome to contact me and make friend with me. Cooperation is welcome.