Is there a fixed amount of memory allowed for a process as a barrier. because after generating a lot of objects in the heap ~ 3*10^8 JVM consumes about 1.162.4 GB of ram and after that it gives OutOfMemoryError. why can't i generate objects till the end of the capacity of the heap? or is this related to the JVM or the operating system is doing this?
class c {
public static void main(String str[]){
int a[] = new int[300000000];
while(true){}
}
}