The JDK imposes whatever limit is set using these switches - if no limit is set, the default maximum heap size is 64 MB. As far as the JDK is concerned, there is no maximum to the amount you can set here. However, if you use more than is available on your operating system, the OS (not the JVM) may limit the size that the JVM can allocate. Or your system my just run incredibly slowly as it is forced to use increasing amounts of virtual memory. All this is system-dependent however - outside the JDK's control.
"I'm not back." - Bill Harding, Twister
Joined: Jan 17, 2001
Sounds logical, But say i have 4 GB of primary available primary memory, and if i start the JVM with a starting size of 3 GB and upto 4GB, will that affect the performance? To summarize my question, does the size of the heap affect the performance?
Joined: Jan 30, 2000
If you've really got that much memory available, then no, it won't affect performance for you to allocate a huge heap. I have a hard time imagining systems and applications where this is both practical and necessary, but if you've got a huge system and nothing better to do with it, go for it.