Question

I am trying to set up a basic file upload to blobstore, but I get this OutOfMemoryError:

WARNING: Error for /_ah/upload/ aghvbWdkcmVzc3IcCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGMACDA java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2786) at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71) at javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java: 316) at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:186) at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109) at com.google.appengine.api.blobstore.dev.UploadBlobServlet.handleUpload(UploadBlobServlet.java: 135) at com.google.appengine.api.blobstore.dev.UploadBlobServlet.access $000(UploadBlobServlet.java:72) at com.google.appengine.api.blobstore.dev.UploadBlobServlet $1.run(UploadBlobServlet.java:100) at java.security.AccessController.doPrivileged(Native Method) at com.google.appengine.api.blobstore.dev.UploadBlobServlet.doPost(UploadBlobServlet.java: 98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:713) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 511);

I used the Memory Analyzer on Eclipse and it said that the memory leak suspect is QueuedThreadPool. I found this information about a memory leak bug:

http://jira.codehaus.org/browse/JETTY-1188

Has anyone else had this issue?

Thanks, Jean

Was it helpful?

Solution

In case anyone comes across this, it's most likely the problem is actually caused by a missing 'name' attribute on the file input field.

See: Uploading to Blobstore gives a Java heap OutOfMemoryError

You should be able to upload files of any size once this is resolved.

OTHER TIPS

It's likely that the development server keeps the file in memory while it's being uploaded and processed. This is not the case on the production server.

How big is the file you're testing with? The simplest solution is to test with smaller files.

I get it with any file size on the dev server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top