adm-zip
adm-zip copied to clipboard
The problem that adm-zip reads zip files takes up a lot of memory!
The problem that adm-zip reads zip files takes up a lot of memory
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?
I tried to replace getEntries with getEntryCount and it couldn't be executed. I didn't study the specific source code! The process of decompressing zip files is a process from small to large! In this decompression process, a lot of operations are required, which will inevitably take up a lot of memory resources! I think this question should be unsolved!
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?