java.lang.OutOfMemoryError occur when upload a large file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.OutOfMemoryError occur when upload a large file

Eric Wei
Hi,

     When I use WinSCP client (with webdav protocal) to upload a large file ( > 1GB),   OutOfMemeryError occur in milton service and tomcat crash.

    The exception message as below: 



     INFO   | jvm 1    | 2017/04/16 18:47:42 | 16 四月 2017 18:47:42:442 ERROR io.milton.http.StandardFilter.process(StandardFilter.java:72) - exception sending content
INFO   | jvm 1    | 2017/04/16 18:47:42 | java.lang.OutOfMemoryError: Java heap space
STATUS | wrapper  | 2017/04/16 18:47:42 | Filter trigger matched.  Restarting JVM.
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.util.Arrays.copyOf(Arrays.java:2271)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1489)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1465)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copy(IOUtils.java:1440)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.toBytes(AnnotationResourceFactory.java:602)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.findArgValue(AnnotationResourceFactory.java:569)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.buildInvokeArgsExt(AnnotationResourceFactory.java:539)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.buildInvokeArgs(AnnotationResourceFactory.java:472)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AbstractAnnotationHandler.invoke(AbstractAnnotationHandler.java:270)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.PutChildAnnotationHandler.execute(PutChildAnnotationHandler.java:54)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnoCollectionResource.createNew(AnnoCollectionResource.java:233)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.http11.PutHandler.processCreate(PutHandler.java:225)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.http11.PutHandler.process(PutHandler.java:199)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.StandardFilter.process(StandardFilter.java:51)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.FilterChain.process(FilterChain.java:40)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.HttpManager.process(HttpManager.java:153)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.servlet.MiltonFilter.doMiltonProcessing(MiltonFilter.java:129)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.servlet.MiltonFilter.doFilter(MiltonFilter.java:104)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
INFO   | jvm 1    | 2017/04/16 18:47:42 | 四月 16, 2017 6:47:42 下午 org.apache.coyote.http11.Http11Protocol pause
INFO   | jvm 1    | 2017/04/16 18:47:42 | 信息: Pausing Coyote HTTP/1.1 on http-80
INFO   | jvm 1    | 2017/04/16 18:47:42 | 四月 16, 2017 6:47:42 下午 org.apache.coyote.http11.Http11Protocol pause
INFO   | jvm 1    | 2017/04/16 18:47:42 | 信息: Pausing Coyote HTTP/1.1 on http-443
INFO   | jvm 1    | 2017/04/16 18:47:44 | 四月 16, 2017 6:47:43 下午 org.apache.catalina.core.StandardService stop
INFO   | jvm 1    | 2017/04/16 18:47:44 | 信息: Stopping service Catalina

   
        How to make milton support large file ?
      
        Thanks & Best Regards.

ERic
2017-04-16





 


_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.OutOfMemoryError occur when upload a large file

bradmacnz

Looks like your method is taking a bye array, please change that to an input stream

On 16 April 2017 10:58:52 pm "Eric Wei" <[hidden email]> wrote:

Hi,

     When I use WinSCP client (with webdav protocal) to upload a large file ( > 1GB),   OutOfMemeryError occur in milton service and tomcat crash.

    The exception message as below: 



     INFO   | jvm 1    | 2017/04/16 18:47:42 | 16 四月 2017 18:47:42:442 ERROR io.milton.http.StandardFilter.process(StandardFilter.java:72) - exception sending content
INFO   | jvm 1    | 2017/04/16 18:47:42 | java.lang.OutOfMemoryError: Java heap space
STATUS | wrapper  | 2017/04/16 18:47:42 | Filter trigger matched.  Restarting JVM.
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.util.Arrays.copyOf(Arrays.java:2271)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1489)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1465)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copy(IOUtils.java:1440)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.toBytes(AnnotationResourceFactory.java:602)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.findArgValue(AnnotationResourceFactory.java:569)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.buildInvokeArgsExt(AnnotationResourceFactory.java:539)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.buildInvokeArgs(AnnotationResourceFactory.java:472)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AbstractAnnotationHandler.invoke(AbstractAnnotationHandler.java:270)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.PutChildAnnotationHandler.execute(PutChildAnnotationHandler.java:54)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnoCollectionResource.createNew(AnnoCollectionResource.java:233)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.http11.PutHandler.processCreate(PutHandler.java:225)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.http11.PutHandler.process(PutHandler.java:199)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.StandardFilter.process(StandardFilter.java:51)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.FilterChain.process(FilterChain.java:40)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.HttpManager.process(HttpManager.java:153)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.servlet.MiltonFilter.doMiltonProcessing(MiltonFilter.java:129)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.servlet.MiltonFilter.doFilter(MiltonFilter.java:104)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
INFO   | jvm 1    | 2017/04/16 18:47:42 | 四月 16, 2017 6:47:42 下午 org.apache.coyote.http11.Http11Protocol pause
INFO   | jvm 1    | 2017/04/16 18:47:42 | 信息: Pausing Coyote HTTP/1.1 on http-80
INFO   | jvm 1    | 2017/04/16 18:47:42 | 四月 16, 2017 6:47:42 下午 org.apache.coyote.http11.Http11Protocol pause
INFO   | jvm 1    | 2017/04/16 18:47:42 | 信息: Pausing Coyote HTTP/1.1 on http-443
INFO   | jvm 1    | 2017/04/16 18:47:44 | 四月 16, 2017 6:47:43 下午 org.apache.catalina.core.StandardService stop
INFO   | jvm 1    | 2017/04/16 18:47:44 | 信息: Stopping service Catalina

   
        How to make milton support large file ?
      
        Thanks & Best Regards.

ERic
2017-04-16





 

_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users

_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.OutOfMemoryError occur when upload a large file

Eric Wei
Hi  Brad,

          Have  got it fixed to change the  parameter of upload method from byte array to InputStream.

          Thanks for your good advice.

ERic

At 2017-04-17 09:41:38, "Brad Mcevoy" <[hidden email]> wrote:

Looks like your method is taking a bye array, please change that to an input stream

On 16 April 2017 10:58:52 pm "Eric Wei" <[hidden email]> wrote:

Hi,

     When I use WinSCP client (with webdav protocal) to upload a large file ( > 1GB),   OutOfMemeryError occur in milton service and tomcat crash.

    The exception message as below: 



     INFO   | jvm 1    | 2017/04/16 18:47:42 | 16 四月 2017 18:47:42:442 ERROR io.milton.http.StandardFilter.process(StandardFilter.java:72) - exception sending content
INFO   | jvm 1    | 2017/04/16 18:47:42 | java.lang.OutOfMemoryError: Java heap space
STATUS | wrapper  | 2017/04/16 18:47:42 | Filter trigger matched.  Restarting JVM.
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.util.Arrays.copyOf(Arrays.java:2271)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1489)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1465)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.commons.io.IOUtils.copy(IOUtils.java:1440)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.toBytes(AnnotationResourceFactory.java:602)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.findArgValue(AnnotationResourceFactory.java:569)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.buildInvokeArgsExt(AnnotationResourceFactory.java:539)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnotationResourceFactory.buildInvokeArgs(AnnotationResourceFactory.java:472)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AbstractAnnotationHandler.invoke(AbstractAnnotationHandler.java:270)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.PutChildAnnotationHandler.execute(PutChildAnnotationHandler.java:54)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.annotated.AnnoCollectionResource.createNew(AnnoCollectionResource.java:233)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.http11.PutHandler.processCreate(PutHandler.java:225)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.http11.PutHandler.process(PutHandler.java:199)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.StandardFilter.process(StandardFilter.java:51)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.FilterChain.process(FilterChain.java:40)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.http.HttpManager.process(HttpManager.java:153)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.servlet.MiltonFilter.doMiltonProcessing(MiltonFilter.java:129)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at io.milton.servlet.MiltonFilter.doFilter(MiltonFilter.java:104)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
INFO   | jvm 1    | 2017/04/16 18:47:42 | at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
INFO   | jvm 1    | 2017/04/16 18:47:42 | 四月 16, 2017 6:47:42 下午 org.apache.coyote.http11.Http11Protocol pause
INFO   | jvm 1    | 2017/04/16 18:47:42 | 信息: Pausing Coyote HTTP/1.1 on http-80
INFO   | jvm 1    | 2017/04/16 18:47:42 | 四月 16, 2017 6:47:42 下午 org.apache.coyote.http11.Http11Protocol pause
INFO   | jvm 1    | 2017/04/16 18:47:42 | 信息: Pausing Coyote HTTP/1.1 on http-443
INFO   | jvm 1    | 2017/04/16 18:47:44 | 四月 16, 2017 6:47:43 下午 org.apache.catalina.core.StandardService stop
INFO   | jvm 1    | 2017/04/16 18:47:44 | 信息: Stopping service Catalina

   
        How to make milton support large file ?
      
        Thanks & Best Regards.

ERic
2017-04-16





 

_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users


 


_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users