[ 
https://issues.apache.org/jira/browse/COMPRESS-597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17445478#comment-17445478
 ] 

Jochen Wiedmann commented on COMPRESS-597:
------------------------------------------

Besides: It would help, if you could post a complete stack trace, and not just 
an error message.

 

And: What are your JVM options?

 

> 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)

Reply via email to