[
https://issues.apache.org/jira/browse/KARAF-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17189180#comment-17189180
]
ASF GitHub Bot commented on KARAF-6837:
---------------------------------------
coheigea opened a new pull request #192:
URL: https://github.com/apache/karaf-decanter/pull/192
…are read from the InputStream for the rest-servlet + socket collectors
I put a configurable limit of 100000 bytes per-request, feel free to adjust
if it's too small.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Place a bound on the data read in the rest servlet + socket collectors
> ----------------------------------------------------------------------
>
> Key: KARAF-6837
> URL: https://issues.apache.org/jira/browse/KARAF-6837
> Project: Karaf
> Issue Type: Task
> Components: decanter
> Reporter: Colm O hEigeartaigh
> Priority: Major
>
> This task is to place a bound on the amount of data read in the rest servlet
> + socket collectors, as otherwise BufferedReader.readLine() will block until
> all data is read, potentially leading to a java.lang.OutOfMemoryError: Java
> heap space error.
> e.g. I see on sending a large file to the rest servlet collector:
> <table>
> <tr><th>URI:</th><td>/decanter/collect/rest-servlet</td></tr>
> <tr><th>STATUS:</th><td>500</td></tr>
> <tr><th>MESSAGE:</th><td>java.lang.OutOfMemoryError: Java heap space</td></tr>
> <tr><th>SERVLET:</th><td>org.ops4j.pax.web.service.spi.model.ServletModel-5</td></tr>
> <tr><th>CAUSED BY:</th><td>java.lang.OutOfMemoryError: Java heap
> space</td></tr>
> </table>
> <pre>java.lang.OutOfMemoryError: Java heap space
> at java.util.Arrays.copyOf(Arrays.java:3332)
> at
> java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
> at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:596)
> at java.lang.StringBuilder.append(StringBuilder.java:190)
> at java.io.BufferedReader.readLine(BufferedReader.java:370)
> at java.io.BufferedReader.readLine(BufferedReader.java:389)
> at
> org.apache.karaf.decanter.collector.rest.servlet.RestServletCollector.doPost(RestServletCollector.java:86)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)