This article provides a detailed analysis of the JVM memory limit of 2 GB in Linux, for more information, see the 32-bit JVM we usually use (64-bit JVM will lose 10-20% performance, which is generally not recommended ), the addressing space of 32-bit programs should be 4 GB. Why does the JVM memory on Linux only use 2 GB?
After communicating with the jdk r & D team, I finally figured out some relevant reasons. This problem exists in some earlier Linux versions, especially those earlier than kernel 2.5. later versions of kernel 2.6 basically do not have this problem. In the past, these Linux versions imposed a 2 GB memory limit on the process, which is the maximum size of memory blocks with a continuous address. The heap size of JVM requires a continuous address space, therefore, 2 GB is the maximum memory used by java process theory.
If a java application requires a large amount of memory, we recommend that you use a newer version of linux, or modify the Linux application/kernel memory ratio to 3 GB: 1 GB. In addition, select a UNIX operating system such as Solaris. For operating systems like Solaris, there is no 2 GB limit on JVM memory management. Therefore, you can set the heap size to around 3.5-GB.
For more details about how to resolve the JVM memory limit of 2 GB in Linux, please follow the PHP Chinese network!