Possible memory leak when repeatedly entering study (pressing S)

Steps to reproduce: I start Anki without addons and spam S (study) on a deck and as you can see the memory rises rapidly. It seems to be mainly QtWebEngineProc that is rising but tbh the vast majority of the memory used I have no clue why.

Please help as I think this is the reason my computer has been freezing up multiple times a day recently.


My investigations below:

I ran some commands and these are the processes that took up the most memory ( i did a diff between the ps command that i give a bit below before and after):
pid 83446 QtWebEngineProc +812460
pid 83426 QtWebEngineProc +644772
pid 83343 python3 +56292
… etc

But since my usage spiked by like 6 GB in btop but when i grabbed the sum of all lines in ps -eo pid,rss,comm --sort=%mem i only got like 1,55 GB in difference so i don’t know where the rest goes.

Anki 25.09.2 (3890e12c)
Python 3.13.7 Qt 6.10.0 PyQt 6.10.0
Platform: Linux-6.17.8-arch1-1-x86_64-with-glibc2.42

I use wayland with Hyprland

After spamming S, > 12 GiB:

After shutting down Anki, <6 GiB:

These are all QT related packages I have installed:
fcitx5-qt 5.1.11-2
hyprland-qt-support 0.1.0-9
kdsoap-qt6 2.2.0-1
polkit-qt6 0.200.0-1
poppler-qt6 25.11.0-1
python-pyqt5 5.15.11-3
python-pyqt5-sip 12.17.1-1
python-pyqt6 6.10.0-1
python-pyqt6-sip 13.10.2-1
python-pyqt6-webengine 6.10.0-1
qca-qt6 2.3.10-4
qscintilla-qt5 2.14.1-4
qt5-base 5.15.18+kde+r109-2
qt5-declarative 5.15.18+kde+r22-1
qt5-location 5.15.18+kde+r7-2
qt5-multimedia 5.15.18+kde+r2-1
qt5-svg 5.15.18+kde+r5-1
qt5-tools 5.15.18+kde+r3-1
qt5-translations 5.15.18-1
qt5-wayland 5.15.18+kde+r55-1
qt5-webchannel 5.15.18+kde+r3-1
qt5-x11extras 5.15.18-1
qt6-5compat 6.10.0-2
qt6-base 6.10.0-3
qt6-declarative 6.10.0-2
qt6-multimedia 6.10.0-3
qt6-multimedia-ffmpeg 6.10.0-3
qt6-positioning 6.10.0-1
qt6-shadertools 6.10.0-1
qt6-speech 6.10.0-1
qt6-svg 6.10.0-2
qt6-translations 6.10.0-1
qt6-wayland 6.10.0-1
qt6-webchannel 6.10.0-1
qt6-webengine 6.10.0-3
quazip-qt5 1.5-1

2 Likes

I can reproduce on debian linux, trixie with gnome and wayland.

If it’s due to you spaming s, I do not see how that is possible. You cannot just hold and press that shortcut, the memory usage won’t increase in that case. And while the memory usage does increase, it doesn’t increase by large amounts. I did spam s for a few minutes and got to over 1.1 GB memory usage; but after waiting for a few minutes, it automatically cleaned itself up to be in the normal memory usage range.

I assume the reason for your freezes must be somewhere else.

Nonetheless, this might be something that should be fixed.

Version Info

Anki 25.09.2 (3890e12c) (ao)
Python 3.13.5 Qt 6.9.1 PyQt 6.9.1
Platform: Linux-6.12.41+deb13-amd64-x86_64-with-glibc2.41

3 Likes

You were right, this does not cause my computer to crash.

Anyways, for me I don’t think it automatically cleans up because my Anki crashes multiple times a day during normal usage (editing cards) and I suspect it’s due to this memory bug, because when it crashed I checked and the memory usage had spiked. Next time it crashes I can post the log.

As a test, I let my anki open for more than half a day of using my computer and also during suspend. Anki didn’t crash even once for me and memory usage doesn’t seem out of the ordinary either.

I do have 64GB of RAM, though, so maybe I won’t see it as early as you would. Though I’d expect to see a general trend of my memory usage increasing if memory leaks were the issue.

That would probably be very helpful, thank you!