tsolomko / SWCompression

A Swift framework for working with compression, archives and containers.
MIT License
233 stars 39 forks source link

[swcomp] Use `autoreleasepool` to immediately free memory when untarring file with rw-api #29

Closed philmitchell closed 2 years ago

philmitchell commented 2 years ago

This relates to this issue.

Using FileHandle to read contents of tarfile does avoid reading entire file into memory. However, without autoreleasepool, the data buffers are not released fast enough to avoid a temporary (potentially large) increase in memory usage.

Cf. Use Local Autorelease Pool Blocks to Reduce Peak Memory Footprint