The maximum memory supported by JDK varies with operating systems. You can use the following method to test the maximum memory supported by different operating systems.
C:> JAVA-xmxxxxxm (G)-version
XXXX indicates the maximum memory size, and M (g) indicates the memory measurement unit. In the preceding command, XXXX is written as a specific number, and m or G is used as the unit, if the command correctly displays the JDK version information, it indicates that the current JDK supports the maximum memory of xxxx. If the current version cannot be correctly displayed, it indicates that the maximum value supported by JDK is exceeded.
For example:
C: \ Users \ Administrator> JAVA-xmx1g-version
Java version"1.6.0 _ 33"
Java (TM) se Runtime Environment (build 1.6.0 _ 33-b03)
Java hotspot (TM) 64-bit server VM (build between 8-b03, mixed mode)
The current JDK supports 1 GB memory. You can slowly test the maximum memory supported by JDK by increasing the XXXX value.
generally, on 32-bit machines, the maximum value is between GB and 2 GB. There should be no limit on 64-bit machines. The version information can be obtained after 9 GB is tested.