EPAM Systems interview question

how memory is managed in java?