On Wed, 5 May 2021 13:20:13 GMT, Vladimir Sitnikov <vsitni...@openjdk.org> 
wrote:

>> We usually don't do that for OutOfMemoryError because concatenation implies 
>> allocation
>
> Well, here `OutOfMemory` is more like "I can't read all the data since the 
> array won't fit".
> It would definitely help to have actual file size there, especially in case 
> filesystem returns weird values (e.g. negative file length).
> 
> This branch will almost never be taken, and even if taken, it won't be "low 
> memory" condition. So the allocation does not hurt, however, it would 
> simplify the analysis should the case trigger.

What about adding the filename into exception message?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3845

Reply via email to