We usually use a 32-bit JVM (64-bit JVM will lose 10-20% performance, usually not recommended), and the 32-bit program should be 4GB to address space, why the JVM memory on Linux only use 2GB?
After communicating with the JDK development team, we finally got some relevant reasons. This problem exists in some earlier versions of Linux, especially in the previous version of Kernel 2.5, which is largely absent from the 2.6 version. The original Linux version of the process has a memory 2GB limit, is an address contiguous memory block size limit, and the JVM heap space (heap size) requires a continuous address space, therefore, 2GB is the Java process theory uses the upper memory limit.
If the Java application requires larger memory, it is recommended to use a newer version of Linux, or modify the Linux application/kernel memory ratio to 3GB:1GB. There is also the choice of Unix operating systems such as Solaris. Operating systems such as Solaris do not have a 2GB limit on JVM memory management, so the heap size can be set to around 3.5-3.6GB.