java-curl
java-curl copied to clipboard
OutOfMemoryError when trying to download a large file
Hi,
When I tried to download a large file (more than 750Mo RPM file), an OutOfMemoryError was thrown. The error is still thrown with 2Go as Xmx.
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3236)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
at com.roxstudio.utils.CUrl$Util.pipeStream(CUrl.java:1573)
at com.roxstudio.utils.CUrl$Util.readStream(CUrl.java:1544)
at com.roxstudio.utils.CUrl.exec(CUrl.java:920)
at com.roxstudio.utils.CUrl.exec(CUrl.java:558)
at com.roxstudio.utils.CUrl.main(CUrl.java:1753)
The command line used :
java -jar -Xmx2g java-curl.jar "[URL to large rpm file]" -o "/tmp/destination.rpm"