Amazon interview question

How would you write a garbage collection algorithm for Java?