cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Knecht (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-2168) ResourceReader produces Java Heap Overflow when reading a huge resource
Date Thu, 14 Feb 2008 14:53:07 GMT

    [ https://issues.apache.org/jira/browse/COCOON-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568953#action_12568953
] 

Felix Knecht commented on COCOON-2168:
--------------------------------------

It seems that the problem is situated somewhere deeper. After fixing the ResourceReader I'm
getting next errors, depending on the pipeline I use (caching/noncaching).

The errors I'm getting now (after applying the attached patch for the ResourceReader with
the test block):
Please replace in the test block the file which is read with a huge file you have on your
machine (no need to attache a 700MB file here).

Caching:
2008-02-14 15:35:20.955:/:INFO:  Apache Cocoon Spring Configurator v1.0.2-SNAPSHOT is running
in mode 'dev'.
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2786)
        at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)
        at org.apache.cocoon.servletservice.ServletServiceContext$StatusRetrievableBufferedWrappedResponse$1.write(ServletServiceContext.java:593)
        at java.io.OutputStream.write(OutputStream.java:99)
        at org.apache.cocoon.util.BufferedOutputStream.writeBuffer(BufferedOutputStream.java:137)
        at org.apache.cocoon.util.BufferedOutputStream.realFlush(BufferedOutputStream.java:127)
        at org.apache.cocoon.reading.ResourceReader.processStream(ResourceReader.java:391)
        at org.apache.cocoon.reading.ResourceReader.generate(ResourceReader.java:420)
        at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processReader(AbstractProcessingPipeline.java:656)
        at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:431)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(PoolableProxyHandler.java:72)
        at $Proxy8.process(Unknown Source)
        at org.apache.cocoon.components.treeprocessor.sitemap.ReadNode.invoke(ReadNode.java:94)
        at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:55)
        at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:87)
        at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
        at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:144)
        at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
        at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:81)
        at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:239)
        at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:171)
        at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:247)
        at org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)
        at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
        at org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:512)
        at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:479

Noncaching:
2008-02-14 15:34:55.179:/:INFO:  Apache Cocoon Spring Configurator v1.0.2-SNAPSHOT is running
in mode 'dev'.
java.lang.OutOfMemoryError: Java heap space
        at org.apache.cocoon.util.BufferedOutputStream.incBuffer(BufferedOutputStream.java:148)
        at org.apache.cocoon.util.BufferedOutputStream.write(BufferedOutputStream.java:96)
        at org.apache.cocoon.caching.CachingOutputStream.write(CachingOutputStream.java:69)
        at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
        at org.apache.cocoon.reading.ResourceReader.processStream(ResourceReader.java:386)
        at org.apache.cocoon.reading.ResourceReader.generate(ResourceReader.java:420)
        at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processReader(AbstractCachingProcessingPipeline.java:866)
        at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:431)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(PoolableProxyHandler.java:72)
        at $Proxy8.process(Unknown Source)
        at org.apache.cocoon.components.treeprocessor.sitemap.ReadNode.invoke(ReadNode.java:94)
        at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:55)
        at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:87)
        at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
        at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:144)
        at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
        at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:81)
        at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:239)
        at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:171)
        at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:247)
        at org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)
        at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
        at org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:512)
        at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:479)
        at org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:230)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)


> ResourceReader produces Java Heap Overflow when reading a huge resource
> -----------------------------------------------------------------------
>
>                 Key: COCOON-2168
>                 URL: https://issues.apache.org/jira/browse/COCOON-2168
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Felix Knecht
>            Assignee: Felix Knecht
>         Attachments: ResourceReader.diff, test-case.tar.gz
>
>
> When reading a huge resource (i.e. 700MB file) the ResourceReader produces an overflow
due to the BufferedOutputStream which is used (and forced to be used via AbstractReader).
The BufferedOutputStream flushes only at the end (or when forced to), but overwrites the flush
method to do nothing.
> As I don't know exactly where the BufferedOutputStream is used and what kind of impacts
it will have to change it there I'm just going to fix the ResourceReader.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message