How to test the maximum memory supported by Java

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.