[
https://issues.apache.org/jira/browse/COMPRESS-597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17445767#comment-17445767
]
Anupama Shinde commented on COMPRESS-597:
-----------------------------------------
@[~jochen] So I am trying to download multiple files in a zip, which is more
than 2gb
I dont have detailed stacktrace,
java.lang.OutOfMemoryError: Java heap space
> causing java.lang.OutOfMemoryError: Java heap space when downloading more
> that 2gb file
> ---------------------------------------------------------------------------------------
>
> Key: COMPRESS-597
> URL: https://issues.apache.org/jira/browse/COMPRESS-597
> Project: Commons Compress
> Issue Type: Bug
> Components: Compressors
> Reporter: Anupama Shinde
> Priority: Critical
>
> I am using ZipArchiveOutputStream to download the file.
> causing java.lang.OutOfMemoryError: Java heap space when downloading more
> that 2gb file
>
>
> protected byte[] BUFFER = new byte[8 * 1024];
> void writeToZipOutputStream(InputStream is, ZipArchiveOutputStream zos)
> throws Exception, IOException
> {
> int i = 0;
> try
> {
> while ((i = is.read(BUFFER)) != -1)
> {
> zos.write(BUFFER, 0, i);
> }
> zos.flush();
> zos.closeArchiveEntry();
> }
> finally
> {
> IOUtils.closeQuietly(is);
> }
> }
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)