Memory leak when rebuilding a Filtered Deck

Anki 25.02.4 (a5c33ad0)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Windows-10-10.0.26100

no add-ons
Direct3D video driver

My workflow is reviewing from the lowest retrievability. I do this using a filtered deck with size 1 and I rebuild it after each card.

It seems rebuilding a filtered deck has a memory leak. Particularly, when I look into Task Manager into the Details tab, the Handles column steadily rises without going back to the original values. Having a lot of handles causes high Committed memory, I got about 60 GB from 3,000 reviews. At about 128 GB total committed memory the system crashes. This happened on Anki 24.11, but it seems to still happen on 25.02.04.

I will try the recommended fixes (reset window size, changing video driver) and also try to confirm that it is still an issue.

To clarify, standard memory does not seem to be so high, but the Committed memory rising to the maximum value is the problem. (Of course Anki restart helps, but it’s really hard to realize that Anki is the problem if one does not already know the problem or is not highly acquainted with Windows memory management.)

Repeatedly building a 1-card Filtered deck is a pretty unusual use case – but it does seem like something Anki should be able to handle without issue.

[I was going to try reproducing this, but in Windows 11 Task Manager > Details, I don’t have any option to show a count of Handles.]

Most memory leak issues I have seen stem from add-ons, but it looks like you’ve already eliminated that as a possibility. If it’s consistently reproducible for you –

  • Are there any more details you can add to your reproduction case? Is it just build a Filtered deck with a limit of 1, study the card, rebuild, repeat?
  • Are you looking at the task/details for anki.exe or for the Qt QtWebEngineProcess instances that run in the background?

Thanks for reaching out!

Probably happens with larger sizes, too, but it’s most pronounced when you rebuilt often.

I use only size 1, because I use sort by latest Card Modified and moving a card into a filtered deck modifies the card, which makes it show up at the top of my browser together with the answer.

You have to right click the column headers and click select columns and choose the Handles columns. I found about these two columns here. Also, the Paged Pool is increasing with the Handles, but the Committed Memory for that process is not increasing (while overall Committed Memory does increase), which makes it really hard to identify the problem.

Just that. I don’t think there’s more that I can add.

anki.exe