compress/flate, archive/zip: large memory allocations reading flate zip archive with many files #59774
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do? What did you see instead?
I noticed large memory allocations reading a flate-endoded zip archive with many files. Looks like opening each file 4KB buffer is allocated (if I read the files sequentially it is not needed - GC does a lot of work). So if I open a zip archive with 50000 files the memory allocations will be about 200 MB in sum just for the buffers.
See the test in the prepared PR for a code example.
What did you expect to see?
Less memory allocations.
The text was updated successfully, but these errors were encountered: