Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10108

PackageMessageFactory can allocate huge amount of memory

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Content Distribution Journal Core 0.1.16
    • None
    • Content Distribution
    • None

    Description

      The PackageMessageFactory consumes the complete binary stream of a distribution package into a single byte array [1]; and depending on the size of the  package this can cause severe memory issues with a potential OOM of the JVM. And even in cases where it's not running into OOM, it can cause major work of the GC to provide a contingous block of heap at that size.

      In logs of existing environments I have seen values up to 390MiB:

      org.apache.sling.distribution.journal.impl.publisher.PackageMessageFactory Creating package binary with id [8702eb49-cf1b-4353-9c3d-67d59f7414f7] for package [dstrpck-1611876137443-cabe281b-4399-46a1-9943-a8c6358c6da2], length [393722362]
      
      

      The logic should be changed, so that the package is not stored within memory, but rather just streamed (if necessary at all).

       

      [1] https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/master/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageMessageFactory.java#L96

      Attachments

        Activity

          People

            Unassigned Unassigned
            joerghoh Joerg Hoh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: