https://itp.nyu.edu/classes/prototypingelectronicdevices/wp-content/uploads/sites/105/2022/11/Class-10-Debugging-Arduino.pdf

<aside> <img src="/icons/bug_gray.svg" alt="/icons/bug_gray.svg" width="40px" />

Debugger

</aside>

<aside> <img src="/icons/art_gray.svg" alt="/icons/art_gray.svg" width="40px" />

RAM Structure

image.png

The above image includes 3 main parts of the RAM (dynamic memory)

Static Data: memorize all the global variable.

Stack and Heap: both utilizing the free memory. They are the memory used during the operation of code. The key difference is that “heap” is actually manually assigned using malloc function. The risk of heap is that, when one parameter is assigned to a definite spot in the free memory, after it’s used, the spot is still occupied and create “hole” in the free memory.

For the “dynamic memory” calculated in the console after an Arduino code is uploaded on the board, it’s only for the static data part.

</aside>