Bug ID: JDK-8246725 Provide MAX_ARRAY_SIZE publicly
A DESCRIPTION OF THE PROBLEM : The JVM may throw an OutOfMemoryError if it cannot allocate an array of the requested size, even if there is enough available memory, see JDK-8029587. The JDK has this maximum size hardcoded at multiple places, but does not expose it publicly.