Upload Maximum Size file giving Memory Out of rage error

374 views
Skip to first unread message

raj

unread,
Jul 20, 2010, 3:04:19 AM7/20/10
to Google Web Toolkit
Hi All,

I am uploading more than 500MB file it is giving this exception

[ERROR] Error for /com.winfoware.voxforce.Index/services
java.lang.OutOfMemoryError: Java heap space
at
org.apache.commons.fileupload.disk.DiskFileItem.get(DiskFileItem.java:
329)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
362)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at
org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:
49)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
395)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:488)
[ERROR] Out of memory; to increase the amount of memory, use the -
Xmx flag at startup (java -Xmx128M ...)
[ERROR] 500 - POST /com.mycomp.xxx.Index/services?method=fileupload
(127.0.0.1) 3302 bytes
Request headers
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
1.9.1.10) Gecko/20100504 Firefox/3.5.10 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=1c875d6p9xi9v
Referer: http://127.0.0.1:8888/Index.html?gwt.codesvr=127.0.0.1:9997
Content-Type: multipart/form-data;
boundary=---------------------------6410314616234
Content-Length: 730633459
Response headers
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3302



Even I am setting Java heap memory size to 1028MB in eclipse for my
testing in development mode
i am not able to upload a file.

i was saw some forums setting java heap size
java -Xms5m -Xmx1028m MyApp

can you please give me suggetions how to resolve this problem using
eclipse and tomcat.



Thanks in advance ,

Raj,
INDIA

rudolf michael

unread,
Jul 20, 2010, 3:05:50 AM7/20/10
to google-we...@googlegroups.com
This was nothing to do with GWT, try to add more memory to your servlet container JVM.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Arthur Kalmenson

unread,
Jul 20, 2010, 8:57:19 AM7/20/10
to google-we...@googlegroups.com
As Rudolf said, this has nothing to do with GWT. Perhaps you should
look at apache commons upload Streaming API:
http://commons.apache.org/fileupload/streaming.html

--
Arthur Kalmenson

rajendra dasari

unread,
Jul 20, 2010, 9:40:46 AM7/20/10
to google-we...@googlegroups.com
Hi ,

Thanks for giving suggetion,
this is not related to GWT,
but  i am facing when i set upload maximum file size to(1024MB - 2GB), but it is giving same error,
i am using the what ever you sent URL only i used.

---

Raj

Stefan Bachert

unread,
Jul 21, 2010, 10:24:25 AM7/21/10
to Google Web Toolkit
Hi Raj,

I think this will not work in general.
On 32 Bit-System Java is limit to somewhat betwenn 1.5-2GByte memory.

Uploading GByte Files may excete this limit. I suspect an upload may
need twice twice the memory in java.

I would consider a different mechanism when uploading such big files
(java-applet, flash, WebDAV..)

Stefan Bachert
http::/gwtworld.de

due to recent cases, I am sorry, I won't do free personal support.
inquiries for professional GWT support are welcome.

On 20 Jul., 15:40, rajendra dasari <rajendra.a...@gmail.com> wrote:
> Hi ,
>
> Thanks for giving suggetion,
> this is not related to GWT,
> but  i am facing when i set upload maximum file size to(1024MB - 2GB), but
> it is giving same error,
> i am using the what ever you sent URL only i used.
>
> ---
>
> Raj
>
> On Tue, Jul 20, 2010 at 6:27 PM, Arthur Kalmenson <arthur.k...@gmail.com>wrote:> As Rudolf said, this has nothing to do with GWT. Perhaps you should
> > look at apache commons upload Streaming API:
> >http://commons.apache.org/fileupload/streaming.html
>
> > --
> > Arthur Kalmenson
>
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsu...@googlegroups.com>
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-we...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsu...@googlegroups.com>
> > .

rajendra dasari

unread,
Jul 21, 2010, 10:34:35 AM7/21/10
to google-we...@googlegroups.com
Hi Stefan Bachert,

Thanks for giving suggestion, i will try on this issue as you told for increasing memory.

---

Raj. 

To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.

cokol

unread,
Jul 21, 2010, 12:21:37 PM7/21/10
to Google Web Toolkit
stop doing that,

its not your intention to load the entire filestream into the
memory?! :-)

you'd be better off with streaming, so on doPost() in your servlet you
could acquire a stream from the request and forward it to your
outputstream on the file system, so only the internal buffer is used.
IN case of huge upload I would not use tools which provides you API on
byte[] level. Apache also has support for fileupload - but its is not
that package which is used to access forms data (there is no streaming
support)

br,

On 21 Jul., 16:34, rajendra dasari <rajendra.a...@gmail.com> wrote:
> Hi Stefan Bachert,
>
> Thanks for giving suggestion, i will try on this issue as you told for
> increasing memory.
>
> ---
>
> Raj.
>
> > > > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>
> > <google-web-toolkit%2Bunsu...@googlegroups.com<google-web-toolkit%252Bu nsubs...@googlegroups.com>
>
> > > > .
> > > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Google Web Toolkit" group.
> > > > To post to this group, send email to
> > google-we...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>
> > <google-web-toolkit%2Bunsu...@googlegroups.com<google-web-toolkit%252Bu nsubs...@googlegroups.com>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-we...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>

rajendra dasari

unread,
Jul 22, 2010, 12:47:30 AM7/22/10
to google-we...@googlegroups.com

Thank you for giving suggestion, ok i will as you given hint

---
Raj
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages