Basic Techniques (cont.)
Mark-Sweep problems
- variable-size objects can cause memory fragmentation
- cost is proportional to heap size
- all live objects must be marked
- all garbage objects must be collected
- locality of reference is lost
- can cause problems with virtual memory