Stack | Heap |
|---|---|
Stores method frames and local variables/references | Stores objects and arrays |
Each thread has its own stack | Shared across threads |
Automatically managed as methods enter/return | Managed by garbage collection |
Generally faster allocation | Used for dynamic object allocation |
Loading…