For anyone with an interest in implementing a basic garbage collector, I recommend SICP[0], specifically section 5.3[1] and the lecture that goes along with it[2].
[0] http://mitpress.mit.edu/sicp/full-text/book/book.html
[1] http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-33.html...