[Zotero 7 Beta] Bug Memory leak in PDF Search
Bug Report:
Current Version: 7.0.0-beta.68+c31a40c74 (64-bit) on Linux
Bug: Memory Leak by using the Search Mask for PDFs repeatedly (old cache is not cleared, even for same pages/results).
Limitations: only in Zotero 7, no Problems in Zotero 6 (Ubuntu 22.04 & MacOS)
To repeat:
1. Open PDF Viewer (preferably large ~200 pages book)
2. Search in-text for e.g. a year (should appear 30-40 times)
3. Skip through finds one time -> +2GB persistent RAM Usage (even that is a bit unnecessary, should be cleared after some time/search skips)
4. Observe first slow downs in search/using zotero
5. Skip through finds another time -> additional increase +2GB+ RAM Usage
6. Repeat. Tested up to + 6GB RAM increase from initial opening of PDF. Crashes the Operating System finally through hogging all Memory.
Problem:
- Search for one key is exemplary for working some time on the PDF and searching for multiple words/sentences -> also accumulates over multiple PDFs. Makes Zotero unusable/slow without repeatedly closing PDFs etc.
- not only is old cache not cleared, same results/pages are cached in Memory again instead of accessing/deleting the previous identical cached page
- Cache seems only to be cleared if PDF is closed in Zotero. Waiting/Closing search does not work.
Current Version: 7.0.0-beta.68+c31a40c74 (64-bit) on Linux
Bug: Memory Leak by using the Search Mask for PDFs repeatedly (old cache is not cleared, even for same pages/results).
Limitations: only in Zotero 7, no Problems in Zotero 6 (Ubuntu 22.04 & MacOS)
To repeat:
1. Open PDF Viewer (preferably large ~200 pages book)
2. Search in-text for e.g. a year (should appear 30-40 times)
3. Skip through finds one time -> +2GB persistent RAM Usage (even that is a bit unnecessary, should be cleared after some time/search skips)
4. Observe first slow downs in search/using zotero
5. Skip through finds another time -> additional increase +2GB+ RAM Usage
6. Repeat. Tested up to + 6GB RAM increase from initial opening of PDF. Crashes the Operating System finally through hogging all Memory.
Problem:
- Search for one key is exemplary for working some time on the PDF and searching for multiple words/sentences -> also accumulates over multiple PDFs. Makes Zotero unusable/slow without repeatedly closing PDFs etc.
- not only is old cache not cleared, same results/pages are cached in Memory again instead of accessing/deleting the previous identical cached page
- Cache seems only to be cleared if PDF is closed in Zotero. Waiting/Closing search does not work.
https://s3.amazonaws.com/zotero.org/images/forums/u2209856/dv68tugm5by8ldfqvz9y.png
@jeremyvancleve Is that also related to search, or does it happen just after a restart? What kind of PDFs are they, i.e., scanned papers?
I can reproduce very high memory usage when scrolling through some PDF files where page rendering is slow, but I don't see anything related to search so far.
I used the beta of the iOS app to download the following article to Zotero:
https://www.biorxiv.org/content/10.1101/2024.03.27.586858v1
When I went back to Zotero 7 beta, the article was in the library, but the PDF icon was partially transparent, so I tried to open the PDF by double clicking on the item.
https://s3.amazonaws.com/zotero.org/images/forums/u2209856/o3h4s9oioouqkzetjwmi.png
This caused Zotero to become sluggish and to start consuming more and more RAM.
With this specific item, I could do this repeatedly, quiting and reopening Zotero and double clicking on the item to trigger the memory leak.
Ok, now I went back to iOS and let the iOS app sync and the PDF now appears fine in the desktop app and it opens fine with no memory leak.
Hope this helps!
Zotero 7.0.0-beta.68+c31a40c74 on macOS 14.4.1
Zotero 1.0.32 build 250 on iOS 17.4.1
I'm the author of zoplicate. I apologize for the inconvenience...
I will fix this bug soon!
Thanks.
Best,
Chenglong
I'm sorry for the memory leak issue has caused to everyone.
I have fixed this problem in version 3.0.0. Please upgrade to the latest version to check it out.
In addition, I have also added some new features, please check https://github.com/ChenglongMa/zoplicate/releases/latest for more details.
Thank you very much for your attention!
Best regards,
Chenglong