Perforce Software Interview Question

Explain Memory allocation in Java