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...
Joined: Feb 15, 2003
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.