Introduction to OOP
Chapter 5: Messages Instances and Initialization:
next
previous
audio
real
text
Memory Recovery
Because in most languages objects are dynamically allocated, they must be recovered at run-time. There are two broad approches to this:
Force the programmer to explicitly say when a value is no longer being used:
delete aCard; // C++ example
Use a
garbage collection
system that will automatically determine when values are no longer being used, and recover the memory.
Intro OOP,
Chapter 5
, Slide 08