Memory Leak on Mac (Plus/Macbook Pro)

I’m observing a really bad memory leak that happens on both my Mac Pro and Macbook Pro (laptop). I suspect may be related to the media sync process. I have enabled the ‘Periodically Sync Media’ option and I can observe the leak growing by simply launching Anki, then just watching it over time without ever using the app in any other way.

The attached screenshots from my Activity Monitor app show the leak after 10 consecutive sync operations, with no other interactions with the app. The third screenshot shows the memory usage has grown to over 3GB in just two days. This eventually gets to 10GB+, after which I have to restart the app because its impacting my system performance.

I need to keep the app open because I regularly create new cards throughout the day as I work.

  1. Can you reproduce if you disable syncing?
  2. Can you reproduce if you disable “Periodically Sync Media”?

For reference, a user report from a few days ago, in case it is related: Possible memory leak when repeatedly entering study (pressing S)

Here is a test with auto-sync disabled. It appears that the leak is still there as memory usage has doubled after reviewing 30 cards with no intervening sync.

1 Like

Try the rest of the Troubleshooting Checklist – especially 2, 4, and 5.

It’s best to not leave Anki running for days at a time – primarily to take advantage of automatic syncing by closing Anki when you leave the app – and on top of that, to avoid add-on/background processes that can create sync conflicts. But for you, it seems like it would avoid this memory leak as well.

I am in the middle of experimenting where I leave Anki open to see if a memory leak occurs.

  • M1 Mac Mini
  • MacOS Tahoe 26.1
  • Anki 25.09.2. Enabled: Synchronize audio and images too, Automatically sync on profile open/close, Periodically sync media
  • No Add-ons installed.

Manually pressing the Sync button repeatedly did not result in memory leak behavior. Per Activity Monitor, Anki’s memory usage on my system seemed to fluctuate within the range of 155-185 MB, going up and down seemingly independent of when I was pressing the Sync button.

Opening up the Add window caused memory usage to jump to the range of 200-225 MB. (I’m leaving Anki open with the Add window open.)

I’ll keep editing this post with updates.

Edit: added:

7 hours later, and Anki memory usage is slightly (20 MB) less than at the start.

17 hours from the start: memory usage was about the same, up 1 MB from 10 hours ago. My computer was in sleep mode for about 7 hours overnight. (It was also in sleep mode for about 1 hour in the previous 7-hour period.) While adding this edit to the post, memory usage increased an additional 1 MB and then decreased by 4 MB, which seems to be the normal fluctuation behavior.)

30 hours from start: memory usage is still about the same.

42 hours from start: memory usage is still about the same.

66 hours from start: memory usage is still about the same. (From 36 hours ago, memory usage has crept up by 2 MB which I still see as just normal fluctuation. Another reminder that my computer is set to sleep when idle.)

88 hours from start: memory usage crept up another 3-4 MB. So, memory usage does seem to be increasing, but very slowly. I’m not sure if this is a memory leak or if it is normal. But, I don’t perceive it to be a problem. Total memory usage doesn’t seem to be that high, relative to other apps.

I also noticed that memory usage increases when I bring the Anki windows into the foreground and then later decreases when the windows are minimized and put into the background.

111 hours from start: Memory usage is now a little bit lower than the last report at 88 hours.

I’m ending the experiment here. I don’t think that I see any obvious memory leak.

2 Likes

I realized I was running Anki 25.02. I upgraded to 25.09.2 and the leak seems to have improved. I re-enabled auto-sync yesterday, then did lots of reviews after updating without a restart. This morning memory usage has crept up to 1.18GB (which is still a lot).

I’ll keep testing and see what I find with the most current release (25.09.02).

It’s important to know here if you’re using any add-ons, as they can contribute to the problem. Can you send the info from Help > About Anki > Copy Debug Info?

Here you go…

Anki 25.09.2 (3890e12c) (ao)
Python 3.13.5 Qt 6.9.1 PyQt 6.9.1
Platform: macOS-15.7.2-x86_64-i386-64bit-Mach-O

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Anki Spell Checker - Check misspelled in the Editor Fixed by Shige [‘143753963’, 2025-06-21T15:15, ‘None’, mod]

===IDs of active AnkiWeb add-ons===
143753963

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.