Sometimes constraints are questionable
Stuart Marks
stuart.marks at oracle.com
Wed Jun 3 16:55:56 UTC 2020
On 6/2/20 11:49 PM, David Holmes wrote:
> IIUC what you are saying is that MAX_ARRAY_LENGTH is treated as a soft-limit. A
> request for prefGrowth won't be allowed to exceed it. But if minGrowth takes the
> length passed it then the code tries to do the allocation that large anyway. If
> it succeeds we win, and if we get OOME that is what we would have thrown anyway
> if we rejected the request as too big.
Yes, that's a good, succinct summary.
> So my misunderstanding in this was that MAX_ARRAY_LENGTH is not attempting to
> define the actual VM hard limit, just a large value close to that which is
> expected to always be valid (actual memory permitting).
Exactly. And sorry for this misunderstanding -- revisiting this I see that the
name MAX_ARRAY_LENGTH is quite misleading. Maybe I should have pushed harder to
change this when Ivan and I went through this code last year. We had improved
some things, I think, but we had already gone through half a dozen rounds of
review and I think we were both getting tired. :-)
s'marks
More information about the core-libs-dev
mailing list