Say I'm running the JVM on a windows machine - if a program uses a lot of memory, and the JVM throws the out of memory exception, does that mean that it ran out of both physical memory and virtual memory? I'm just wondering if the JVM makes that dinstinction at all, because if that's the case, then that's a huge amount of memory...
I figured out that it can't tell the difference - But now the question is, is there a way to tell the JVM to take up as much memory as it needs? Ie, it's maximum memory allocation is whatever free memory windows has left? I've tried specifying an arbitrarily huge number, but that doesn't work.
Sun's JVMs don't have a "grow without bounds" switch. They do have a "grow up to such and such a limit" switch, as you've apparently already figured out. The largest possible value for this on Windows is either about 1.8 GB or 2.8GB, depending on Windows version/patch level. It's possible to use the largest legal value regardless of the size of the memory on the machine.
In my testing, I've been able to specify -Xmx1588M on this windows 2k box. 1588Mb works out to be 1.55Gb. Since my total memory is 1280Mb I'm going to guess that 1588 is a W2K limit.
Don't get me started about those stupid light bulbs.