You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Wirz <mi...@abs.de> on 2005/04/08 15:28:20 UTC

Out Of Memory error using ResourceReader

Hello List,


when trying to serve big zip files through cocoon we encounter 
OutOfMemoryErrors.
Our setup is as follows:

(default) reader definition:
 <map:readers default="resource">
    <map:reader logger="sitemap.reader.resource" name="resource" 
pool-max="32" src="org.apache.cocoon.reading.ResourceReader"/>
 </map:readers>


pipeline matching the request:
  <map:match pattern="*/downloads/special/*.zip">
      <map:read src="downloads/{1}/{2}.zip" mime-type="application/zip"/>
   </map:match>


Does anyone know whether there's a filesize limitation?
Any work arounds other than increasing heap memory?
Is there a way to stream the binary (i.e. a StreamingReader or similar)?

Thanks in advance for help,
Michael

-- 
abs IT Service GmbH
Ein Unternehmen der abs Gruppe
Michael Wirz
Entwicklung

Landsberger Straße 57
82266 Stegen am Ammersee

Telefon: +49-(0)8143-999-43
Telefax: +49-(0)8143-999-49

michael.wirz@abs.de
www.eFonds24.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Out Of Memory error using ResourceReader

Posted by Michael Wirz <mi...@abs.de>.
Hello List!

I managed to find the answer to my own question.
The pipeline reads the entire file into memory by default.  With the
<map:parameter name="outputBufferSize" value="8192"/>
entry, you can set the buffer size, so it doesn't fill up the entire 
heapspace.  It is also advised to set the pipeline type to noncaching 
that so the entire cache isn't filled with the large file.

Here is an example:
<map:pipeline type="noncaching">  <map:parameter name="outputBufferSize" 
value="8192"/>  <map:match pattern="**.zip">
   <map:read src="{1}.zip" mime-type="application/octet-stream"/> 
 </map:match>
</map:pipeline>

Thank you,
Michael Wirz

> Hello List,
>
>
> when trying to serve big zip files through cocoon we encounter 
> OutOfMemoryErrors.
> Our setup is as follows:
>
> (default) reader definition:
> <map:readers default="resource">
>    <map:reader logger="sitemap.reader.resource" name="resource" 
> pool-max="32" src="org.apache.cocoon.reading.ResourceReader"/>
> </map:readers>
>
>
> pipeline matching the request:
>  <map:match pattern="*/downloads/special/*.zip">
>      <map:read src="downloads/{1}/{2}.zip" mime-type="application/zip"/>
>   </map:match>
>
>
> Does anyone know whether there's a filesize limitation?
> Any work arounds other than increasing heap memory?
> Is there a way to stream the binary (i.e. a StreamingReader or similar)?
>
> Thanks in advance for help,
> Michael
>


-- 
abs IT Service GmbH
Ein Unternehmen der abs Gruppe
Michael Wirz
Entwicklung

Landsberger Straße 57
82266 Stegen am Ammersee

Telefon: +49-(0)8143-999-43
Telefax: +49-(0)8143-999-49

michael.wirz@abs.de
www.eFonds24.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org