Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Content Distribution Journal Core 0.1.16
-
None
-
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).