A simple mark-sweep garbage collector in Java