I initialize in main array.
int[] integers = new int[Integer.MAX_VALUE-2]; One element of type int is 4 bytes, such elements are 2147483645 and 4 bytes are for the size of the array. 4 * 2147483645 + 4 = 8.6 gigabytes. I allocate 10 gigabytes for VM -Xms10g -Xmx10g and get the exception OutOfMemoryError: Java heap space Why?
-XX:NewRatio, etc. - zRrr