开发者

OutOfMemoryError trying to upload to Blobstore locally

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-1开发者_如何学运维188

Has anyone else had this issue?

Thanks, Jean


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜