Files.copy(InputStream, Path, CopyOption...) can fail with OOM if direct memory is limited

Alan Bateman Alan.Bateman at oracle.com
Wed Sep 13 07:41:31 UTC 2023


On 12/09/2023 22:39, github at paul.kungfoocoder.org wrote:
> Do others agree that this is something that should be fixed?

I've created JDK-8316156 [1] to look at this. The wrapping of the byte[] 
and writing the full size to the channel has always been there, but 
maybe not really noticed either due to usages or not limiting direct 
memory like you are doing.

-Alan

[1] https://bugs.openjdk.org/browse/JDK-8316156


More information about the nio-dev mailing list