I have a class that run infinit (do nothing, just loop and sleep), called NeverReturn. I try to run it using following command in Windows XP 32bit:
java -Xms1200M NeverReturn
I find with the command I can create only 4 java instance at same time. The 5th and next java command will failed to create jvm.
If I change the command to -Xms600M, I can create 8 java instance. The 9th will failed.
Could anyone explain that? I'm using sun jdk1.6 update 23 and jdk1.5 update 22.
If you have four instances of the JVM each using 1200M of memory, that gives you 4800M of memory allocated.
If you have eight instances of the JVM each using up to 600M of memory, that gives you 4800M of memory as well.
If I had to guess, it looks like the problem is that you're trying to promise more memory to the JVM instances than exists on your system. Dropping the amount of memory you promise should have a corresponding increase in the number of instances you can run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With