EsupPortail/esup-filemanager — pull request #24 by mxbossard (2013-12-06 13:02:49+00:00)
Title: FIX Zipping large files consume huge amount of JVM memory

Zipping of large files was performed with a huge "in memory" buffer, which was an exact copy of the file to zip. This buffer is embbeded in the IOUtils.toByteArray() method. This is a problem because a big amount of Heap can be consumed by this mechanism which can lead to OOMErrors.

To fix this, we now use a unique limited buffer with a fixed size of 128 kB per archive zipping. This means that one unique buffer of 128 kB is build and assigned for each archive to zip.

Moreover, we enhanced the OutputStreams management by closing them in a cleaner way.