Bug 64387

Summary: Big POIFS stream result in OOM
Product: POI Reporter: Andreas Beeker <kiwiwings>
Component: POIFSAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 4.1.x-dev   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Andreas Beeker 2020-04-28 23:04:53 UTC
In [1] it was noticed, that encrypting huge streams result in OOMs.
This was due to cached ByteBuffers of NIO channels, which were necessary because of mmap problems in Windows.

I've introduced now a release method, to unmap buffers, which aren't used anymore. So unmapping makes only sense in stream like handling, where buffers aren't revisited anymore.

[1] https://stackoverflow.com/questions/61463301/apache-poi-throwing-oom-error-when-trying-to-password-protect-modest-sized-xlsx
Comment 1 Andreas Beeker 2020-04-28 23:08:54 UTC
Applied via r1877144