Adding many Mathjax Notes fills up Memory and causes Slowdowns
- Dominant language
- Rust
- Stars
- 30.5k
- Forks
- 3.2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 72
Description
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:
1. Add several cards with anki mathjax (about 40 or more)
2. 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
Contributor guide
Research direction
No source file, test, or entry point is identified in the report. Reproduce the issue by adding about 40 MathJax cards while monitoring QtWebEngineProcess memory and rendering time; done means the cause of the growth and slowdown is isolated and addressed with verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100