Please review: Bug: https://bugs.openjdk.java.net/browse/JDK-8170977 Webrev: http://cr.openjdk.java.net/~hannesw/8170977/webrev/
With this we keep whatever is already allocated as dense array but do not grow it up to the dense array length limit internally. I also reduced the max dense array length as with 1 million dense elements we still risk to be very wasteful with memory. Thanks, Hannes