Anonymous Content interview question

how memory management is done in java?