<- Back | Index | Forward ->
Garbage Collection
Data which is no longer needed should be returned to the system so the
space may be reused.
- Manual garbage collection
- Explicit allocation and deallocation,
- Used by C and the Daylight toolkit,
- About 20% of a the Daylight API calls are to dt_dealloc!
- Hard to ensure no memory leaks (Purify)
- Automatic garbage collection
- Mark and sweep
- Used by Java, Eiffel, Smalltalk
- Doesn't work well with uncooperative C libraries
- Reference counting
- Used by Python and Perl
- Can get memory leaks with cyclic data structures