Perl does garbage collection by reference counting. The drawback is circular reference.
Java does this by mark-and-sweep.
C# does this by mark-and-compaction. Mark is similar to Java. Compaction is to copy used blocks together to avoid memory fragmentation.
A usual way of doing garbage collection is:
1) establish directed graph on objects.
2) do reachability test and mark reachable objects.
3) remove unreachable objects.
See here: A Simple Garbage Collector for C++.
Friday, April 9, 2010
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2010
(67)
-
▼
April
(14)
- Find median
- Find Median of Two Sorted Arrays
- Online Algorithm Resources
- Max submatrix problem
- Check Equality of Two Number Sets
- Largest rectangle in histogram problem
- IR Evaluation
- Garbage collector implementation
- Find prime numbers
- Newton Ralphson's method to calculate square root
- The Frobenius Number
- Search in a circular sorted array
- The Maximal Rectangle Problem
- Young Tableau
-
▼
April
(14)
1 comment:
Cool.
Post a Comment