This is lesson 3 of 5 in this module Course 11% complete

Heap Memory

Premium Content

Sign in with your account or join us to access this lesson.

We introduce heap memory and contrast it with the stack using a refactored drawPolygon example that allocates a Line array on the heap, showing how local variables on the stack hold references to heap objects and why a garbage collector is necessary.