[ 
https://issues.apache.org/jira/browse/OFBIZ-10133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16311030#comment-16311030
 ] 

Deepak Dixit commented on OFBIZ-10133:
--------------------------------------

 I noticed the 512. Can you tell me how this number came to be? 

I don;t know, I think it came from old tomcat configuration,


It's kind of small. Were you trying to increase simultaneous connections?

I am proposing to make it configurable,  User can configure it as per need. No 
need to hard code in java file, 

public static final int bufferSize = UtilProperties.getPropertyValue("content", 
"maxbuffersize", 512);

or similar


> streaming large content cause out of memory exception.
> ------------------------------------------------------
>
>                 Key: OFBIZ-10133
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10133
>             Project: OFBiz
>          Issue Type: Bug
>          Components: content
>    Affects Versions: Trunk
>            Reporter: Wai
>         Attachments: OFBIZ-10133.patch, OFBIZ-10133.patch, OFBIZ-10133.patch, 
> OFBIZ-10133.patch, OFBIZ-10133.patch
>
>
> When ofbiz streams a large content (eg. video file), get out of memory 
> exception.
> console output...
> 2018-01-01 05:01:03,933 |jsse-nio-8443-exec-2 |MycoReqMapHandlerBase         
> |E| Java heap space
> java.lang.OutOfMemoryError: Java heap space
>         at 
> org.apache.commons.io.output.ByteArrayOutputStream.needNewBuffer(ByteArrayOutputStream.java:127)
>  ~[commons-io-2.5.jar:2.5]
>         at 
> org.apache.commons.io.output.ByteArrayOutputStream.write(ByteArrayOutputStream.java:158)
>  ~[commons-io-2.5.jar:2.5]
>         at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2147) 
> ~[commons-io-2.5.jar:2.5]
>         at org.apache.commons.io.IOUtils.copy(IOUtils.java:2102) 
> ~[commons-io-2.5.jar:2.5]
>         at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2123) 
> ~[commons-io-2.5.jar:2.5]
>         at org.apache.commons.io.IOUtils.copy(IOUtils.java:2078) 
> ~[commons-io-2.5.jar:2.5]
>         at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:721) 
> ~[commons-io-2.5.jar:2.5]
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to