Open wangmings opened 2 years ago
I face the problem too, si that possible to make the get entities as a lazy iterator?
It seems it already support it(do not use getEntities is a key part)?
https://github.com/cthackers/adm-zip/blob/bebbabf600a6ae5d64ee31cbc89a1274bd1d8c1f/zipFile.js#L140
https://github.com/cthackers/adm-zip/blob/bebbabf600a6ae5d64ee31cbc89a1274bd1d8c1f/zipFile.js#L148
https://github.com/cthackers/adm-zip/blob/bebbabf600a6ae5d64ee31cbc89a1274bd1d8c1f/zipFile.js#L25
@wangmings can you have a try?
Currently adm-zip loads entire file into memory, and handles things there. Yes iterators exists but they are not lazy.
I think there is also a memory leak present in adm-zip
or memory fragmentation under Linux. Causing memory to increase every time I unzip the same file. And not giving the memory allocation back to the system. 😢
I'm trying to add support for Blob instead of Buffer so that only the needed data could be put into memory with .slice(...). This should allow opening huge zip files (e.g. 50GB) as well (as long as the single files to extract are still fitting into an ArrayBuffer.)
I'm trying to add support for Blob instead of Buffer so that only the needed data could be put into memory with .slice(...). This should allow opening huge zip files (e.g. 50GB) as well (as long as the single files to extract are still fitting into an ArrayBuffer.)
How did this go, anything merged?
Support for streaming would be appreciated, I'm trying to extract files > 2 GiB.
I moved to Go.. Problem solved 🥳 . https://gitlab.melroy.org/melroy/gitlab-artifact-deployer-go/-/blob/main/server.go?ref_type=heads#L181
The problem that adm-zip reads zip files takes up a lot of memory