JVM Memory Defaults
Solution 1
As documented:
- Xmx: default 64M
- Xms: default 2M
That's for Linux, but I've checked and the values are the same for Windows and Solaris too. Don't rely on that being the case for other versions or options though. In particular, the choice of server or client VM depends on operating system, at least in later versions.
Another piece of documentation
Solution 2
From Sun's tooldocs:
-Xmsn Specify the initial size, in bytes, of the memory allocation pool. This value must be a multiple of 1024 greater than 1MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 2MB. Examples:
-Xms6291456 -Xms6144k -Xms6m
-Xmxn Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. Examples:
-Xmx83886080 -Xmx81920k -Xmx80m
So 2MB and 64MB.
(The link above is for the 1.5 docs, but you can download the 1.4 docs, and they say the same thing.)
amanagg1204
Updated on October 30, 2022Comments
-
amanagg1204 over 1 year
What is the default Xms and Xmx settings for the Sun JVM (v 1.4*) if those values are not specified at startup?
-
palantus almost 15 yearsIs it the same in 1.4, though?
-
Jon Skeet almost 15 yearsAs it happens, yes... but I've linked the 1.4 docs in my answer.
-
Laurence Gonsalves almost 15 yearsInteresting. I'd linked to the 1.5 docs because when I tried to get the 1.4 docs it redirected me to a download page. Apparently 1.4.2 doesn't do this yet, though.
-
Daisuke Shimamoto almost 12 yearsI know the question was for 1.4 but you can find one for Java 6 at docs.oracle.com/javase/6/docs/technotes/guides/vm/…