[
http://jira.magnolia-cms.com/browse/MGNLDMS-159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Philipp Bärfuss reopened MGNLDMS-159:
-------------------------------------
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.
Here are some notes for a potential future solution:
a) use a shared session for the read access. Since the voter only reads file
sizes we won't run into security issues.
--> we should not use shared sessions as in the past we experienced memory
issues because of doing that
b) cache a special entry for big files
- instead caching the file we just cache a reference (bypass entry) so the test
has to be executed only once
c) us a special threshold stream which streams into a temp file after a certain
amount of data has bean streamed
> Caching big documents from dms repository causes OutOfMemoryError
> -----------------------------------------------------------------
>
> Key: MGNLDMS-159
> URL: http://jira.magnolia-cms.com/browse/MGNLDMS-159
> Project: Magnolia DMS Module
> Issue Type: Bug
> Affects Versions: 1.3
> Environment: Magnolia 3.6.3 CE
> Environment1: Sun JDK 1.6.0_11, 32bit, RHEL 5.3Beta
> Environment2: Sun JDK 1.6.0_03,32bit, Windows 2000
> Reporter: Henryk Paluch
> Assignee: Jan Haderka
> Fix For: 1.4 rc1
>
> Attachments:
> config.modules.cache.config.configurations.default.cachePolicy.voters.urls.excludes.dmsNoCache.xml,
> oom_stacktrace.txt
>
>
> magnolia-module-cache caches on public instance all data into byte[] array
> which easily causes OutofMemoryError on large repositories.
> NOTE: this error occures on Public instances only, whose has caching enabled!
> How to reproduce:
> 1) Start PUBLIC magnolia instance with Heap smaller than DMS repository size,
> for example -Xmx256m
> 2) Upload on PUBLIC instance few large files (for example 3 times 100MB PDF
> files)
> 3) Launch new anonymous browser (to ensure, that cache is used)
> 4) Download (do not interrupt) the 3 large 100MB large files from public
> instance
> 5) Usually the 2nd download will cause
> java.lang.OutOfMemoryError: Java heap space
> at java.util.Arrays.copyOf(Arrays.java:2786)
> at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)
> at
> info.magnolia.module.cache.filter.SimpleServletOutputStream.write(SimpleServletOutputStream.java:53)
> (Full stacktrace shall be attached later)
> Woraround: disable caching for large repositories (attachment pending)
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------