NTT DATA interview question

How JVM allocated memory?