Adding many Mathjax Notes fills up Memory and causes Slowdowns
Hello,
I am deeply enjoying Anki-Mathjax. Thank you for all your hard work!
I have likely found a memory leak connected to it: If one creates many mathjax cards, it impacts performance heavily. This can be seen in the following ways:
- Rendering takes considerably longer after long usage
- The QtWebEngineProcess fills up multiple gigabytes of RAM (On weak hardware might lead to a crash)
I am not deep into the source, but I suspect that after adding a card, the web-renderer is not "cleaned up".
Steps to reproduce:
- Add several cards with anki mathjax (about 40 or more)
- Notice performance and RAM usage
System:
- Lenovo Thinkpad X390 Yoga
- Fedora Linux 37 Workstation
- Anki Version (Flatpak): Version 2.1.57 (6b7d372c)
- Python 3.9.15
- Qt 6.4.2
- PyQt 6.4.0
Thank you for considering my Issue. I'll be happy to answer any followup questions
Edit: New update on flathub, still occurs with Version 2.1.58 (ab8b1465) Python 3.9.15 Qt 6.4.2 PyQt 6.4.0
Hey @Libric0, could you confirm this issue with the official version Qt5 and Qt6 rather than with flathub?
You are welcome to continue using your distro's version of Anki if you prefer, but if you run into any issues, you will need to report them to your distribution's package maintainers. https://docs.ankiweb.net/platform/linux/installing.html
Ah yes of course, i am so sorry I didn't think of it.
I reproduced it with the QT6 version.
Qt5 Will not start properly for me, just a bank canvas with a menu bar. So I won't be able to test it out here for now
Hello,
I’m still experiencing this issue with Anki 25.09.2 (using Python 3.13.7, Qt 6.10.0 and Chromium 134) on Arch GNU/Linux (I use the AUR anki-bin package).
I entered a card with 14 mathjax fields, and Anki took 1 Go of my memory. Even after clicking “Add” and moving to another card, Anki still uses 1 Go of RAM.
Don’t hesitate to ask me further information.