[jira] [Comment Edited] (OFBIZ-10133) streaming large content cause out of memory exception.

2018-01-13 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux edited comment on OFBIZ-10133 at 1/13/18 9:38 AM:
--

OK Wai, it was late and I know now that [what you did is 
correct|https://docs.oracle.com/javase/8/docs/api/java/io/FilterInputStream.html#read-byte:A-int-int-],
 

I Completed: At revision: 1821054  ; notably for R16 to use the same code, so 
closing


was (Author: jacques.le.roux):
OK Wai, it was late and I know now that [what you did is 
correct|https://docs.oracle.com/javase/8/docs/api/java/io/BufferedInputStream.html#read--],
 so closing

> 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
>Assignee: Jacques Le Roux
> Fix For: 17.12.01, 16.11.05
>
> Attachments: OFBIZ-10133.patch, OFBIZ-10133.patch, OFBIZ-10133.patch, 
> 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)


[jira] [Comment Edited] (OFBIZ-10133) streaming large content cause out of memory exception.

2018-01-05 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux edited comment on OFBIZ-10133 at 1/5/18 9:53 AM:
-

Thanks Wai,

After our discussion on dev ML on the final for properties point, I'll apply 
your patch in 3 days with these last change, except if someone has something 
else to say?


was (Author: jacques.le.roux):
Thanks Wai,

After our discussion on dev ML on the final for properties point, I'll apply 
your patch in fex days with these last change, except if someone has something 
else to say?

> 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, 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)


[jira] [Comment Edited] (OFBIZ-10133) streaming large content cause out of memory exception.

2018-01-04 Thread Wai (JIRA)

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

Wai edited comment on OFBIZ-10133 at 1/4/18 2:16 PM:
-

Jacques,
BufferedOutputStream uses a default of 8k.
I chose 4k and I make the stack based "byte[] buffer" as 2k.


was (Author: wt):
Jacques,
BufferedOutputStream uses a default of 8k. I chose 4k.

> 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)


[jira] [Comment Edited] (OFBIZ-10133) streaming large content cause out of memory exception.

2018-01-04 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux edited comment on OFBIZ-10133 at 1/4/18 8:54 AM:
-

Yes Wai, that was somehow my question. Deepak, why 512, and if you know, why 
this comment
bq. // same as the default buffer size; change as needed
What is the default buffer size :-o? Why do you want to keep it at 512 by 
default?

Also Wai, why did you pick 4 * 1024?

Sorry lot of questions :)


was (Author: jacques.le.roux):
Yes Wai, that was somehow my question. Deepak, why 512, and if you know, why 
this comment
bq. // same as the default buffer size; change as needed
What is the default buffer size :-o? Why do you want to keep it at 512 by 
default?

Also Wai, why did you pick 4 * 1024?

Sorry lot of questions :) ?

> 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
>
>
> 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)