<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 00:49:00 CET 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[MGNLDMS-159] Caching big documents from dms repository causes OutOfMemoryError</title>
                <link>https://jira.magnolia-cms.com/browse/MGNLDMS-159</link>
                <project id="10112" key="MGNLDMS">Document Management System (closed)</project>
                    <description>&lt;p&gt;magnolia-module-cache caches on public instance all data into byte[] array which easily causes OutofMemoryError on large repositories.&lt;/p&gt;

&lt;p&gt;NOTE: this error occures on Public instances only, whose has caching enabled!&lt;/p&gt;

&lt;p&gt;How to reproduce:&lt;br/&gt;
1) Start PUBLIC magnolia instance with Heap smaller than DMS repository size, for example -Xmx256m&lt;br/&gt;
2) Upload on PUBLIC instance few large files (for example 3 times 100MB PDF files)&lt;br/&gt;
3) Launch new anonymous browser (to ensure, that cache is used)&lt;br/&gt;
4) Download (do not interrupt) the 3 large 100MB large files from public instance&lt;br/&gt;
5) Usually the 2nd download will cause&lt;/p&gt;

&lt;p&gt;java.lang.OutOfMemoryError: Java heap space&lt;br/&gt;
	at java.util.Arrays.copyOf(Arrays.java:2786)&lt;br/&gt;
	at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)&lt;br/&gt;
	at info.magnolia.module.cache.filter.SimpleServletOutputStream.write(SimpleServletOutputStream.java:53)&lt;br/&gt;
(Full stacktrace shall be attached later)&lt;/p&gt;

&lt;p&gt;Woraround: disable caching for large repositories (attachment pending)&lt;/p&gt;

&lt;p&gt;Possible solution: cache module should stream large files into disk rather than memory (as it did in 3.0.x version). This should prevent OutOfMemory error on large Document and or Website repositories.&lt;/p&gt;</description>
                <environment>Magnolia 3.6.3 CE&lt;br/&gt;
Environment1: Sun JDK 1.6.0_11, 32bit, RHEL 5.3Beta&lt;br/&gt;
Environment2: Sun JDK 1.6.0_03,32bit, Windows 2000&lt;br/&gt;
</environment>
        <key id="16352">MGNLDMS-159</key>
            <summary>Caching big documents from dms repository causes OutOfMemoryError</summary>
                <type id="1" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10883&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="had">Jan Haderka</assignee>
                                    <reporter username="henryk.paluch">Henryk Paluch</reporter>
                        <labels>
                            <label>cache</label>
                            <label>outofmemoryerror</label>
                    </labels>
                <created>Tue, 17 Mar 2009 09:20:04 +0100</created>
                <updated>Thu, 3 Jul 2014 16:10:17 +0200</updated>
                            <resolved>Wed, 1 Dec 2010 17:02:05 +0100</resolved>
                                    <version>1.3</version>
                                    <fixVersion>1.5</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="21817" author="henryk.paluch" created="Tue, 17 Mar 2009 09:21:02 +0100"  >&lt;p&gt;oom_stacktrace.txt - stacktrace of OutOfMemoryError&lt;br/&gt;
when on Documens download from public instance&lt;/p&gt;</comment>
                            <comment id="21818" author="henryk.paluch" created="Tue, 17 Mar 2009 09:24:28 +0100"  >&lt;p&gt;config.modules.cache.config.configurations.default.cachePolicy.voters.urls.excludes.dmsNoCache.xml&lt;br/&gt;
Workaround example:&lt;br/&gt;
Do not cache items from &quot;dms&quot; repository.&lt;/p&gt;

&lt;p&gt;We are using this workaround on our production system: It has about 4GB documents, typical size of one documen is 5MB, some of them are 100MB long.  Heap size is 1.5GB&lt;br/&gt;
Without this workaround that system stop working with OutOfMemoryError after a while.&lt;/p&gt;</comment>
                            <comment id="22079" author="had" created="Thu, 2 Apr 2009 10:54:31 +0200"  >&lt;p&gt;Done as of r24144.&lt;/p&gt;</comment>
                            <comment id="23049" author="pbaerfuss" created="Mon, 8 Jun 2009 14:09:31 +0200"  >&lt;p&gt;I have reverted the current fix. The reason is that this voter creates a jcr session per request to the dms. This can be very critical you, like we do in STK, store background images in the dms. This results in opening 20 sessions per page, even witch cache switched on.&lt;/p&gt;

&lt;p&gt;Here are some notes for a potential future solution:&lt;/p&gt;

&lt;p&gt;a) use a shared session for the read access. Since the voter only reads file sizes we won&apos;t run into security issues.&lt;br/&gt;
--&amp;gt; we should not use shared sessions as in the past we experienced memory issues because of doing that&lt;/p&gt;

&lt;p&gt;b) cache a special entry for big files&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;instead caching the file we just cache a reference (bypass entry) so the test has to be executed only once&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;c) us a special threshold stream which streams into a temp file after a certain amount of data has bean streamed &lt;/p&gt;</comment>
                            <comment id="23051" author="pbaerfuss" created="Mon, 8 Jun 2009 14:10:58 +0200"  >&lt;p&gt;If we re add the voter we definitely have to consider &lt;a href=&quot;https://jira.magnolia-cms.com/browse/MGNLDMS-166&quot; title=&quot;cache: deny url doesn&amp;#39;t work because the file size check always votes positively&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MGNLDMS-166&quot;&gt;&lt;del&gt;MGNLDMS-166&lt;/del&gt;&lt;/a&gt; which was just fixed by reverting the current fix.&lt;/p&gt;</comment>
                            <comment id="23095" author="had" created="Tue, 9 Jun 2009 09:27:16 +0200"  >&lt;blockquote&gt;&lt;p&gt;c) us a special threshold stream which streams into a temp file after a certain amount of data has bean streamed&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Stream is not the only problem with this solution. Binary items have to be passed to ehCache in &lt;tt&gt;CachedPage&lt;/tt&gt; as &lt;tt&gt;Byte[]&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="31529" author="pbaerfuss" created="Wed, 1 Dec 2010 17:02:05 +0100"  >&lt;p&gt;Fixed by &lt;a href=&quot;https://jira.magnolia-cms.com/browse/MAGNOLIA-2677&quot; title=&quot;Caching big content may cause OutOfMemoryError&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MAGNOLIA-2677&quot;&gt;&lt;del&gt;MAGNOLIA-2677&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10030">
                    <name>Cloners</name>
                                                                <inwardlinks description="is cloned by">
                                        <issuelink>
            <issuekey id="16415">MAGNOLIA-2677</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>relation</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="16697">MGNLDMS-166</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="12232" name="config.modules.cache.config.configurations.default.cachePolicy.voters.urls.excludes.dmsNoCache.xml" size="1928" author="henryk.paluch" created="Tue, 17 Mar 2009 09:24:28 +0100"/>
                            <attachment id="12231" name="oom_stacktrace.txt" size="5750" author="henryk.paluch" created="Tue, 17 Mar 2009 09:21:02 +0100"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_14166" key="com.okapya.jira.checklist:checklist">
                        <customfieldname>Acceptance criteria</customfieldname>
                        <customfieldvalues>
                            
        <checklist>
        <![CDATA[
                            




                
                                    <div class="o-completion" style="display: flex; flex-shrink: 0;"><span  class="aui-lozenge aui-lozenge-complete" style="font-size: 12px; font-weight: normal; display: flex; flex-direction: row; align-items: center;" ><span style="padding-right: 4px; vertical-align: middle;"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="white"><path clip-rule="evenodd" d="m10.41037,3.42544l-7.86501,0c-0.72395,0 -1.31084,0.58688 -1.31084,1.31084l0,7.86508c0,0.7239 0.58689,1.3108 1.31084,1.3108l7.86501,0c0.724,0 1.3109,-0.5869 1.3109,-1.3108l0,-7.86508c0,-0.72396 -0.5869,-1.31084 -1.3109,-1.31084zm-7.86501,-0.65542c-1.08593,0 -1.96626,0.88032 -1.96626,1.96626l0,7.86508c0,1.0859 0.88033,1.9662 1.96626,1.9662l7.86501,0c1.086,0 1.9663,-0.8803 1.9663,-1.9662l0,-7.86508c0,-1.08594 -0.8803,-1.96626 -1.9663,-1.96626l-7.86501,0z" fill-rule="evenodd"/><path d="m5.09049,10.18526l-1.82767,-1.82766l-0.78479,0.78479l2.61246,2.61246l5.38758,-5.38754l-0.78483,-0.78479l-4.60275,4.60274z"/></svg></span><span>Empty</span></span></div>
                        ]]>
    </checklist>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>deltax.cz</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 2 Apr 2009 10:54:31 +0200</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>mmuehlebach</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 12 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>henryk.paluch</customfieldvalue>
            <customfieldvalue>had</customfieldvalue>
            <customfieldvalue>pbaerfuss</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03hpb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20464</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>