Pregunta de entrevista de Integrated Research

What does the garbage collector do in Java?