Creating ZIP archives in Google App Engine (Java) <br />
I am got this error in the gae cloud logs:  <br>

java.lang.OutOfMemoryError: Java heap space <br>
at java.util.Arrays.copyOf(Arrays.java:2271)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113) 
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
<br><br>



Creating ZIP archives in Google App Engine (Java) <br />
I am got this error in the gae cloud logs:  <br>

java.lang.OutOfMemoryError: Java heap space <br>
at java.util.Arrays.copyOf(Arrays.java:2271)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113) 
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)<br><br>

I face this problem when zipping many files on the production server, 
so what should I do to fix it ? is there something can help in GAE 
or can I save zip file containing one file on the storage then open 
and edit it ? ( to min memory usage) 


ByteArrayOutputStream zipBaos = new ByteArrayOutputStream();
    ZipOutputStream zipOut = new ZipOutputStream(zipBaos);
    byte[] tmpBuf = new byte[1024];


while end of files{
   byte[] fileContents = getFileContent(); // it is OK
   zipOut.putNextEntry(new ZipEntry(fileNameStr));

   ByteArrayInputStream in = new ByteArrayInputStream(fileContents);
   int len;
   while ((len = in.read(tmpBuf)) > 0) {
        out.write(tmpBuf, 0, len);
    }

    zipOut.closeEntry();}


zipOut.close();

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/e84f99c4-2312-4b8f-80b4-a0d93d8c6be2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to