https://bugs.kde.org/show_bug.cgi?id=503364
Bug ID: 503364 Summary: K7Zip Appears to Extract the Whole Archive When Calling KArchive::open Classification: Frameworks and Libraries Product: frameworks-karchive Version: 6.13.0 Platform: Other OS: Linux Status: REPORTED Severity: major Priority: NOR Component: general Assignee: kio-bugs-n...@kde.org Reporter: bryantc...@gmail.com CC: kdelibs-b...@kde.org Target Milestone: --- SUMMARY KArchive takes a long time to open 7z archives compared to other software. Opening a 7z archive and getting the entry list in Ark is essentially instant. Noticed the time it took for KArchive to open the same 7z archive seemed to be about the same as it would take for Ark to extract that archive. Looking at memory usage when my software was opening said archives I noticed the memory usage was much higher than when opening other archives. It would spike up initially when opening by several times the size of the archive then drop down. Even after it was opened it is still using much more memory for the instance of the K7Zip compared to other archives. Just having it open appears to have about as much memory in use by it as the entire archive. Which makes me think that K7Zip is extracting the whole archive to memory when calling KArchive::open. STEPS TO REPRODUCE For repro steps I will give two options since the behavior can be seen with any program utilizing KArchive for 7z support. Also will mention the archive in question I was using for testing was a folder with 200 jpgs in it at around 150MB in total size. Option 1: Okular 1. Using Okular open a .cb7 archive compressed with either LZMA, LZMA2, or BZip2. BZip2 is recommended since it will take the longest so will be most noticeable. Any of them are fine though. 2. Check the memory it is using 3. Now make a cbz of the contents of that archive and look at the difference in memory usage when opening it in Okular Option 2: Create a small snippet of code 1. Create a small snippet of code that simply opens an archive and gets the entry list. With debug messages between the steps. OBSERVED RESULT For Okular you will notice that it takes significantly longer to open a a cb7 archive compared to cbz while using more memory. For the snippet of code you will notice it hanging on the open. EXPECTED RESULT For it to open in a timely manner and not have essentially the whole archive loaded into RAM. SOFTWARE/OS VERSIONS Linux: 6.14.2 KDE Plasma Version: 6.3.4 KDE Frameworks Version: 6.13.0 Qt Version: 6.8.2 ADDITIONAL INFORMATION This behavior dates quite far back I have a Pop!_OS 20.04 system I still use for some things which also experiences the exact same issue with a long time to open and high memory usage with K7Zip. So this issue appears to have been around for at least 5 years it seems. Hope my explanation of the bug/issue is good enough it might be a little confusing with the wording opening. Some may think I am referring to extracting it or something, but I am just referring to creating an IODevice essentially and just reading the entry list which shouldn't take any real amount of time with modern processors I believe. Certainly shouldn't if Ark and other archive tools which don't rely on KArchive can show the entry list near instantly. -- You are receiving this mail because: You are watching all bug changes.