Skip to the content.

Memory Management

Back to Homepage
Week 2


There are only

  1. Allocate
  2. Deallocate
  code and static vars stack heap
location always same (static) varies varies
size always same always same varies
lifetime infinity block scope as long as you want

Garbage Collector

If you can’t reach it via stack or pointer, it’s garbage