Cloudera interview question

What does garbage collector do in Java