Amazon Interview Question

How would you write a garbage collection algorithm for Java?