java-curl icon indicating copy to clipboard operation
java-curl copied to clipboard

OutOfMemoryError when trying to download a large file

Open adeo20007757 opened this issue 5 years ago • 0 comments

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"

adeo20007757 avatar Sep 16 '20 08:09 adeo20007757