Glovo interview question

Memory management in Java