RFR: 8190753: (zipfs): Accessing a large entry (> 2^31 bytes) leads to a negative initial size for ByteArrayOutputStream [v2]
Alan Bateman
Alan.Bateman at oracle.com
Thu Jul 1 08:43:46 UTC 2021
On 30/06/2021 17:15, Jaikiran Pai wrote:
>
> I understand that Alan's suggestion holds good and we should have some
> logic in place which switches to using a temp file once we notice that
> the sizes we are dealing with can exceed some threshold, but I guess
> that is something we need to do separately outside of this PR?
My comment was mostly just to point out that it's only a partial fix and
it will eventually fail with an OOME once the deflated size is too big
for the BAOS. I don't have a strong opinion on whether the complete fix
is done in one, two or many PRs but I think the first step could be to
use the "useTempFile" path when the entry size is larger than some (10s
of MB?) threshold.
-Alan
More information about the nio-dev
mailing list