Extremely high memory usage in MacOS

2»
  • @Daoer: That's normal. Zotero is based on Firefox and will see similar memory usage. If I start Firefox and open just that PDF (which contains various photos and charts), memory usage ends up around 850 MB. If I scroll to the last page, it goes up to 1.4 GB.

    Unless you're actually running out of system memory and your system is swapping, this isn't something you need to worry about. (If the memory wasn't going back down when you closed the PDF, that would be a memory leak and would be something we would want to know about.)
  • Those who are experiencing very high memory fluctuation while scrolling please do a test:

    1) Maximize Zotero window, zoom PDF to page width and start scrolling.
    2) Shrink Zotero window as much as you can and start scrolling.

    Please report the memory fluctuation minimum and maximum for both cases.

    If you have an external monitor with retina resolution that is even better to test.

    Please include your OS and resolution.
  • @dstillman: Thanks for your reply and patience. I have got what you mean. I don't find the memory leakage right now, but it does run out of my system memory and cause swapping. Because my work flow needs me to keep many apps alive. Sorry to complain that, Zotero just occupies too much memory and it always consumes the most memory. It seams all caused by the poorly optimized built-in pdf reader, because when I switch to the external pdf reader, the memory usage keeps stable(although still higher<800MB> than I expect it should be). At least I have found use external pdf reader could be a method to avoid the extremely high memory usage. Thanks a lot.

    @martynas_b: Here is the info I test this (only one) pdf(https://arxiv.org/pdf/2309.11497.pdf) on DELL U2720QM which is a 4k external monitor 3840*2160. 

    My Zotero version is 7.0.0-beta.43+f803c0cc4 without any plugins abled. My device is MacBook Air 16GB with macOS Sonoma 14.0 (23A344).
    For case1: max=3.52GB, min=2.45GB
    For case2: max=2.15GB, min=1.61GB
    Hope this will help you.
  • What is the typical memory usage on normal computers?
  • Any news on this?

    On my MacBook Air M1 with 8GB of RAM, right after the system boot, Zotero uses almost 1GB of RAM without any PDF file open.
  • Hi all,
    Yesterday my MacBook Air (M1 2020, 16 GB RAM) warned me that Zotero (6.0.30) was gobbling up memory. When I looked into it, it had 80 GB (!) on it. I had 7 PDFs (academic papers, some with more images than others) open (I did not know that was a crime LOL).
    I closed Zotero and opened it again this morning with the same PDFs open. Now, mem usage is at ca. 750 MB.
    Will try the beta and report on any new strange behaviour.

    Today,
  • It always takes 13GB on my m1 mac with 16GB RAM, but I only open less than 8 pdfs.
  • @Zhuxiangjv Do you have third-party plugins? Try to disable them if so. Also which Zotero version do you use?
  • At first 6.30, have 2 plugins only. If I exit and open zotero, memory usage will be about 1.5G. I installed version 7 yesterday, all plugins cannot work on this version. But still takes a lot memory, about 3GB. And some times much more. @martynas_b
  • I have the same issue. My M1 Mac mini with 8 GB of RAM struggles whenever I have Zotero opened (even with one pdf). One PDF will take up 1.5GB and I usually use Obsidian with Zotero to take notes. The Mac Mini runs fine otherwise and it feels a bit silly to upgrade my Mac and it seems like even with 16GB RAM, people are still struggling with the memory gobble.

    Also, it doesn't seem like Zotero 7 improves the situation. I installed it briefly to test it out and it is consuming the same amount of RAM.

    I would hate to move away from Zotero, but if the memory issue continues, I don't know if I have a choice. Please help!

    (P.S. I have Better BibTex and some other Plugins installed, all those were disabled when I tried Zotero 7 Beta and it doesn't help even without the Plugins)
  • edited March 18, 2024
    I'm having the same experience in my MBP M1 2020 running the latest Z7 beta. It starts using around 600-800 MB, opening a couple of pdf books puts it well into the 1.5-2 GB range. By comparison, opening the same books in Preview uses about 200 MB. I don't expect Zotero to ever reach such low figures, but current memory usage is not normal.

    EDIT: my workspace is a test one with just three linked books and no plugin.

    EDIT: I wouldn't say this is related to a leak, memory usage fluctuates a lot, when interacting (like scrolling a doc) memory may easily scale up to one additional GB and then downscale again.
  • @mmplx: 1.5–2 GB while PDFs are open is normal. You'll see similar figures (spread across multiple processes) in Firefox. (Zotero's PDF reader is based on the one from Firefox, and does a lot more.) It's not comparable to Preview.
  • @dstillman: ok, then. I don't use Firefox but have been testing this a bit with Chrome reader (not based on pdf.js I suppose), and although leaner it still takes 300-400 MB to load the first book, so in this regard it's not that different. One difference is that variable costs seem lower, each additional book doesn't increase memory usage that much and closing the last pdf shows a sharp decrease in memory usage.

    But, more importantly, these peaks of +1 GB when, say, scrolling through 10 pages of a book, are they expected? Do they happen in Firefox too? I'm not seeing anything like that in Chrome. Agreed, they downscale quite fast, but are huge nonetheless.
  • edited March 20, 2024
    @dstillman: an update based on a closer examination I've been carrying out.

    1. Contrary to Chromium-based apps, whose memory usage tends to spread across many processes, most of them not windowed ones, Zotero memory is mainly concentrated in one process that is obviously more prominent in Activity Monitor.

    2. Most of the allocated memory seems to be readily swapped out (or compressed) when other apps demand it. I guess entire pdf renderings are loaded but for the most part their contents will be accessed with very low frequency and it doesn't harm performance to move them out of physical memory (or to compress ir).

    3. With 16 GB of RAM, Chrome + 6 PWAs, VSCode, Spotify and Zotero w/about 6 open pdfs I've only seen memory pressure go to yellow once, for a brief moment, other than that it's green all the time.

    This is not to say that Zotero hasn't a a high memory usage (it's the app with the greatest memory usage in my system) but perhaps things look worse than they actually are because of point (1) above.
  • Updated and is now using a ton of memory. 2 PDFs open and it's using 1.88GB of memory?

    https://s3.amazonaws.com/zotero.org/images/forums/u3059994/88ki40zm2spjw5q9nbni.png

    Never had this issue prior to the latest update.

  • @abodywithoutorgans: I suggest that you also look at real/private/shared/compressed memory columns. The main number may be somewhat misleading, a large part of that memory could have been swapped out or compressed, and a significant part is probably shared memory. Again, I do think that Zotero may use less memory, but the figure you show is not extreme IMO, it's probably not quite lineal on the amount or size of open books, and doesn't mean that other apps can't reclaim a good share of it without affecting performance in any noticeable way. At least that was the case in my (admittedly cursory) experiments.
  • Just to illustrate my point, this is Zotero "at rest" with a couple of open books.

    https://s3.amazonaws.com/zotero.org/images/forums/u13653181/tutc9fqhxqet759b0aib.png
  • Was using enough memory that I received a "Your system has run out of application memory" message. (This is on a M1 iMac with 8gb memory). This is obviously a problem. Have never seen this message before, whether using Zotero or any app.

    Meanwhile on my Intel Macbook Air, five pdfs open and 595.2mb.

    https://s3.amazonaws.com/zotero.org/images/forums/u3059994/1u0fz8vue0n4yfchlnse.png
  • @abodywithoutorgans: That likely has more to do with the PDFs you have open — or whether you've actually opened the tabs recently — than Zotero 6 vs. 7. I'd be very surprised if you had actually opened the tabs recently if Zotero is under 600 MB. That's about what Zotero uses at startup.

    If you open the same five PDFs, restart Zotero, and move through each tab so that they're loaded into memory, I suspect you'd see about the same memory usage in both versions. If not, let us know. (On an 8 GB machine, we currently actually only keep 3 tabs loaded, so memory usage should go down when the last two are unloaded.)

    We're going to be making some changes to better respond to system memory conditions — keeping more PDFs in memory when the system has memory to spare and purging loaded tabs when the system is under memory pressure. And we'll see whether there's anything we can do to reduce memory usage in the reader in general, but again, some of this is just inherent to the cross-platform framework.

    (The real issue here, arguably, is that Apple hasn't raised the amount of RAM in the base model of most of its computers in over a decade…)
  • Thanks so much, @dstillman. I appreciate this and will check this out closer on Monday.
  • If the desktop version requires firefox, is it possible to just make zotero ipad also available for macos? that looks like an efficient native app. I don't even use the pdf function of zotero but it still takes up at least 2g memory.
  • With about 28 pdf open in 'new' window, the memory is at about 21GB.

    Low memory warning comes from time to time.
    I'm on a MacBook Air M2, with 8GB of RAM.

    https://s3.amazonaws.com/zotero.org/images/forums/u6389321/adn19pr3y84ns856i9x4.png

    Thanks for fixing this.
  • @Inflight: When you open PDFs in tabs, Zotero only keeps a certain number of PDFs loaded at a time in order to keep memory usage in check. If you open them in windows, they all remain loaded, so you'll see much higher memory usage, particularly if any of the PDFs are large, have large compressed images, etc.

    We could look into unloading PDFs in background windows and just keeping a static image loaded or something like that, but for now, on an 8 GB machine, I would recommend using tabs instead of windows.
  • I just want to say this is still a problem on my Mac Air. Zotero regularly uses 2-3gb of ram and basically any other pdf programme with the equivalent number of open pdfs is much lighter.
  • @dstillman, I wish this were the case. I just opened ~200mb over 10pdfs and all memory use is consolidated in one "Preview" line in activity viewer, and it hasn't pushed over 480mb memory. I wish Zotero "closed" pdfs but left the tab open as Zotero opens pdfs really quickly, as you have suggested.
  • edited 16 days ago
    @pcourtney: You seem to have either not read or misunderstood the comment I linked to and the rest of this thread. As I say, Preview will use much less memory — it’s not comparable. The comparable thing is Firefox across its various processes. And Zotero does unload tabs automatically, as we discuss above extensively. I explain the changes we have planned above.
  • I tried the same pdf opened via the pdf.js on my firefox. It will release the memory as I closed the tab. But zotero seems not to release the memory after I close the pdf.
Sign In or Register to comment.