Created: 2024-01-28 09:25
Status: #concept
Subject: Programming
Tags: Reference Pass-by-Reference Stack Data Structure

Execution Stack

A section of computer memory dedicated to holding non-Reference types.

Value Types

"Value types" are stored in the CPU's execution stack inside stack frames (or activation records), once the Scope of that value is destroyed, the stack frame is deallocated from Memory.

  • when there are too many stack frames, due to Recursion, it will create a Stack Overflow and break the program due to lacking memory.

References Types

These types are typically Pointers to Objects and their Memory Address values are stored in the stack, which point to regions in memory called the Memory Heap.

int[] data;
data = new int[3];

References