[Zotero 7 Beta] Bug Memory leak in PDF Search

.se
edited March 25, 2024
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.



  • I think I'm seeing this too.
  • I just restarted Zotero with 17 pdfs open and the memory usage exploded and the app become unresponsive.


  • @.se Does it happen with all PDF files?

    @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.
  • edited March 27, 2024
    yes I think it seems to be related to search though in my case search in the library, not within a pdf. I haven't seen it again but will document better when I do.
  • edited March 31, 2024
    Hi @martynas_b, I have more info on the memory leak.

    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.

    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
  • @jeremyvancleve Was the sync in progress (with the spinner spinning) when the PDF icon was partially transparent?
  • Yes I think so. I'm not sure how to replicate the partially transparent PDF icon, but I'll pay attention to that next time.
  • In case it helps: iOS Debug Log: D1876557278
  • Memory leak again and yes the sync was in progress on the desktop client
  • Do you have the Zoplicate plugin? I had the same problem but it resolved after I deleted the plug in.
  • edited April 8, 2024
    oh I do yes. damn, I'll try that.
  • @mgwientjes: did you file a bug on the zoplicate github repo?
  • Hi all,

    I'm the author of zoplicate. I apologize for the inconvenience...

    I will fix this bug soon!

    Thanks.

    Best,
    Chenglong
  • @mgwientjes, thanks for the hint. Zotero 7 was freezing and totally unusable. Uninstalling the zoplicate fixed the issue (by quickly switching to Troubleshooting mode after starting the program). I hope @Chenglong could work out a fix soon.
  • Hi @.se, @jeremyvancleve, @martynas_b, @mgwientjes, @cmnkumar, and all,

    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
Sign In or Register to comment.