Uploaded image for project: 'Document Management System (closed)'
  1. Document Management System (closed)
  2. MGNLDMS-159

Caching big documents from dms repository causes OutOfMemoryError

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.5
    • 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

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              had Jan Haderka
              Reporter:
              henryk.paluch Henryk Paluch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: