I have created following class and ran on 15 terminals with command "java -Xms500m Class1".
I was expecting it to not allow me after 4 or 5 separate executions. I was expecting something like cannot create more JVMs but all programs are running. If each JVM creation requires 500Mb of initial heap memory (my RAM is 2GB) then the maximum limit of JVM creation should be four.
public class Class1
{
public static void main(String[] args)
{
int i=0;
while(true)
{
try
{
Thread.currentThread().sleep(100);
System.out.println("hi-"+i);
}
catch (InterruptedException e)
{
}
i++;
if(i == 1000000)
{
break;
}
}
}
Thanks, Amaresh