ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-10133) streaming large content cause out of memory exception.
Date Thu, 04 Jan 2018 19:52:00 GMT

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

Jacques Le Roux commented on OFBIZ-10133:

OK I should have not focused on this point only.

# I don't understand why you divide the BUFFERSIZE by 2 when creating the buffer; rather than
using the passed length like before
# As I said before, BUFFERSIZE should be named bufferSize
# Why? because BUFFERSIZE is a variable which depends on a properties. Properties are cached
and can be changed. You simply change the value in the properties file and clear the cache
in webtools (either all caches or only the properties cache). So you see it's not a constant.
We use EntityUtilProperties here, but same can happen with DB values, just change it and clear
# Because of that, BUFFERSIZE should not be final. Actually this is not the only case OOTB.
We have 53 such other cases. Sometimes it could maybe make sense, though I don't see how/why
from the top of my head. I'll address this point to the dev ML, so please wait for that before
changing it.

> 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
> 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)
>         at org.apache.commons.io.output.ByteArrayOutputStream.write(ByteArrayOutputStream.java:158)
>         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

View raw message