Out of interest - Does a default exist or is it different on each OS?
If it does, what are the defaults? Incredibly hard to find!
Out of interest - Does a default exist or is it different on each OS?
If it does, what are the defaults? Incredibly hard to find!
According to java documentation the default for the Sun/Oracle Windows and Solaris/Linux JVMs are 64MB. This could be different for different JVM vendors though. For example, the default -Xmx value for JRockit is the lesser of 75% of the total amount of memory or 1GB.
If you are curious about what maximum amount of memory you can use on your JVM, at runtime you can call:
System.out.println(Runtime.getRuntime().maxMemory());
You can find the details in the Java 5.0 Ergonomics documentation. Specifically: