why garbage collection?
why
- computation uses memory for intermediate values
- this memory can be reclaimed
the alternative
- “manual storage management”
- the programmer must explicitly free memory
- easy to not free enough (“storage leak”)
memory is lost to inaccessible data
- or to free too much
programming languages
- with automatic storage management: Lisp, CLU, Modula, Java
- without: Pascal, C, C++