EPAM Systems Interview Question

how memory is managed in java?