Bug - Memory Leak (MacOS)

Platform: Mac M1 2020
OS: Sonoma 14.2
Anki Version: 24.04 (429bc9e1)⁩
RAM: 8 GB

Using Anki causes increase in memory usage over time until eventually I get a using too much memory popup window. Anki would use around 7GB normally and could spike up to 15 GB when my laptop only has 8 GB. I have tried the temporary disabling addons and it started at a lower point but still increased memory usage pretty quickly (around 1 GB to 4 GB in less than an hour). I also thought this might be an issue with my note type, but after trying it with a simple note type the issue still persists. I’m using Activity Monitor to track memory usage. Some possible causes of this might be using the three finger drag to switch between full windows or somehow the monitoring is causing a memory leak (because when I switch to Activity Monitor it jumps up a bit after a few seconds, but it could also be that it just takes a few seconds to update the Activity Monitor display).

Including some additional information from Activity Monitor below:


Open Files and Ports:

/
/Applications/Anki.app/Contents/MacOS/anki
/Applications/Anki.app/Contents/MacOS/lib/wrapt/_wrappers.cpython-39-darwin.so
/Applications/Anki.app/Contents/MacOS/lib/google/_upb/_message.abi3.so
/System/Library/CoreServices/SystemVersion.bundle/English.lproj/SystemVersion.strings
/Applications/Anki.app/Contents/MacOS/lib/orjson/orjson.cpython-39-darwin.so
/private/var/db/mds/messages/506/se_SecurityMessages
/Applications/Anki.app/Contents/MacOS/lib/charset_normalizer/md.cpython-39-darwin.so
/Applications/Anki.app/Contents/MacOS/lib/charset_normalizer/md__mypyc.cpython-39-darwin.so
/private/var/db/analyticsd/events.allowlist
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/sip.cpython-39-darwin.so
/System/Library/Frameworks/Security.framework/Versions/A/PlugIns/csparser.bundle/Contents/MacOS/csparser
/private/var/db/timezone/tz/2024a.1.0/icutz/icutz44l.dat
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtWebChannel.abi3.so
/Applications/Anki.app/Contents/Frameworks/QtDBus.framework/Versions/A/QtDBus
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtWebEngineWidgets.abi3.so
/Applications/Anki.app/Contents/Frameworks/QtQuickWidgets.framework/Versions/A/QtQuickWidgets
/Applications/Anki.app/Contents/Frameworks/QtOpenGL.framework/Versions/A/QtOpenGL
/Applications/Anki.app/Contents/Frameworks/QtWebChannel.framework/Versions/A/QtWebChannel
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtCore.abi3.so
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtNetwork.abi3.so
/Applications/Anki.app/Contents/Frameworks/QtNetwork.framework/Versions/A/QtNetwork
/Applications/Anki.app/Contents/Frameworks/QtWebEngineWidgets.framework/Versions/A/QtWebEngineWidgets
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtGui.abi3.so
/Applications/Anki.app/Contents/Frameworks/QtQmlModels.framework/Versions/A/QtQmlModels
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtWebEngineCore.abi3.so
/Applications/Anki.app/Contents/Frameworks/QtPrintSupport.framework/Versions/A/QtPrintSupport
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtQml.abi3.so
/Applications/Anki.app/Contents/MacOS/lib/anki/_rsbridge.so
/Applications/Anki.app/Contents/Frameworks/QtCore.framework/Versions/A/QtCore
/usr/share/icu/icudt72l.dat
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtQuick.abi3.so
/Applications/Anki.app/Contents/Frameworks/QtPositioning.framework/Versions/A/QtPositioning
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtPrintSupport.abi3.so
/Applications/Anki.app/Contents/MacOS/lib/markupsafe/_speedups.cpython-39-darwin.so
/Applications/Anki.app/Contents/Frameworks/QtGui.framework/Versions/A/QtGui
/Applications/Anki.app/Contents/Frameworks/QtQuick.framework/Versions/A/QtQuick
/Applications/Anki.app/Contents/Frameworks/QtQml.framework/Versions/A/QtQml
/Applications/Anki.app/Contents/MacOS/lib/pvectorc.cpython-39-darwin.so
/Applications/Anki.app/Contents/MacOS/libankihelper.dylib
/Applications/Anki.app/Contents/Frameworks/QtWidgets.framework/Versions/A/QtWidgets
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/SystemAppearance.car
/System/Library/Input Methods/JapaneseIM-RomajiTyping.app/Contents/PlugIns/JapaneseIM-RomajiTyping.appex/Contents/Resources/InfoPlist.loctable
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/QtWidgets.abi3.so
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/com.apple.IntlDataCache.le.kbdx
/System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/InfoPlist.loctable
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/FauxVibrantDark.car
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/platforms/libqcocoa.dylib
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Aqua.car
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/Common.loctable
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/styles/libqmacstyle.dylib
/Applications/Anki.app/Contents/Resources/qt_translations/qtbase_en.qm
/System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/0/com.apple.LaunchServices.dv/com.apple.LaunchServices-5019-v2.csstore
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/DarkAqua.car
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantDark.car
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Assets.car
/System/Library/Fonts/SFNS.ttf
/System/Library/Fonts/Menlo.ttc
/usr/lib/libobjc-trampolines.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqgif.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqwbmp.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqico.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqmacheif.dylib
/System/Library/Video/Plug-Ins/VCPHEVC.bundle/Contents/Resources/InfoPlist.loctable
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqsvg.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqicns.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqtga.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqmacjp2.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqwebp.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqjpeg.dylib
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/imageformats/libqtiff.dylib
/System/Library/Fonts/Helvetica.ttc
/Applications/Anki.app/Contents/Frameworks/QtSvg.framework/Versions/A/QtSvg
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_resources_100p.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_resources_200p.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_locales/en-GB.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/icudtl.dat
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_resources.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_devtools_resources.pak
/System/Library/Extensions/AGXMetal13_3.bundle/Contents/Resources/ds.g13g
/System/Library/Extensions/AppleMetalOpenGLRenderer.bundle/Contents/MacOS/AppleMetalOpenGLRenderer
/System/Library/Fonts/SFNSItalic.ttf
/Library/Fonts/Microsoft/Times New Roman.ttf
/System/Library/Fonts/Apple Symbols.ttf
/System/Library/Fonts/Supplemental/Zapfino.ttf
/System/Library/Fonts/Supplemental/Apple Chancery.ttf
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/InputManager.loctable
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/MenuCommands.loctable
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/Menus.loctable
/Applications/Anki.app/Contents/MacOS/lib/PyQt6/Qt6/plugins/iconengines/libqsvgicon.dylib
/System/Library/PrivateFrameworks/Shortcut.framework/Versions/A/Resources/Localizable.loctable
/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app/Contents/Resources/en.lproj/ServicesMenu.strings
/System/Library/Fonts/SFGeorgian.ttf
/System/Library/Fonts/SFHebrew.ttf
/System/Library/Fonts/ThonburiUI.ttc
/System/Library/Fonts/SFArmenian.ttf
/System/Library/Fonts/Supplemental/Lao Sangam MN.ttf
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/net.ankiweb.dtop/com.apple.metal/16777235_322/functions.data
/Library/Caches/com.apple.iconservices.store/5C25E958-51DD-30E4-B21E-1719CCC6348E.isdata
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/DictationManager.loctable
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/net.ankiweb.dtop/com.apple.metal/32023/libraries.data
/System/Library/PrivateFrameworks/Shortcut.framework/Versions/A/Resources/SearchManager2.loctable
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/Services.loctable
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/com.apple.iconservices/store.index
/System/Library/Fonts/Keyboard.ttf
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/Accessibility.loctable
/System/Library/Fonts/SFArabic.ttf
/System/Library/Fonts/NotoNastaliq.ttc
/System/Library/Fonts/LucidaGrande.ttc
/System/Library/Fonts/KohinoorBangla.ttc
/System/Library/Fonts/Supplemental/Khmer Sangam MN.ttf
/Library/Fonts/Microsoft/Consolas.ttf
/Library/Fonts/Microsoft/Consolas Italic.ttf
/System/Library/Fonts/Supplemental/Malayalam Sangam MN.ttc
/System/Library/Fonts/NotoSansArmenian.ttc
/Library/Fonts/Microsoft/Consolas Bold.ttf
/Library/Fonts/Microsoft/Consolas Bold Italic.ttf
/System/Library/Fonts/KohinoorGujarati.ttc
/System/Library/Fonts/NotoSansOriya.ttc
/System/Library/Fonts/Supplemental/Tamil Sangam MN.ttc
/System/Library/Fonts/NotoSansMyanmar.ttc
/System/Library/Fonts/Kohinoor.ttc
/System/Library/Fonts/Supplemental/Sinhala Sangam MN.ttc
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/QtWebEngineCore
/System/Library/PrivateFrameworks/SFSymbols.framework/Versions/A/Resources/CoreGlyphs.bundle/Contents/Resources/Assets.car
/System/Library/Fonts/Supplemental/Kokonor.ttf
/System/Library/Fonts/MuktaMahee.ttc
/System/Library/Fonts/Supplemental/EuphemiaCAS.ttc
/System/Library/Fonts/NotoSansKannada.ttc
/System/Library/Fonts/KohinoorTelugu.ttc
/System/Library/Fonts/Supplemental/Kefa.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W3.ttc
/System/Library/Fonts/HelveticaNeue.ttc
/System/Library/Fonts/Supplemental/STIXTwoMath.otf
/System/Library/Fonts/Supplemental/Galvji.ttc
/Library/Fonts/Microsoft/Arial.ttf
/System/Library/Fonts/Supplemental/Arial.ttf
/Library/Fonts/Microsoft/Arial Italic.ttf
/System/Library/Fonts/Supplemental/Arial Italic.ttf
/Library/Fonts/Microsoft/Arial Bold Italic.ttf
/System/Library/Fonts/PingFang.ttc
/System/Library/Fonts/AppleSDGothicNeo.ttc
/Library/Fonts/Microsoft/Arial Bold.ttf
/System/Library/Fonts/Supplemental/Arial Bold.ttf
/System/Library/Fonts/Supplemental/Arial Bold Italic.ttf
/System/Library/Fonts/Apple Color Emoji.ttc
/System/Library/Fonts/Supplemental/Arial Unicode.ttf
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W0.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W1.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W2.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W4.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W5.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W6.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W7.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W8.ttc
/System/Library/Fonts/\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe8\xa7\x92\xe3\x82\xb3\xe3\x82\x99\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf W9.ttc
/System/Library/Fonts/Hiragino Sans GB.ttc
/System/Library/Fonts/GeezaPro.ttc
/System/Library/Fonts/Supplemental/Thonburi.ttc
/System/Library/Fonts/Supplemental/Kailasa.ttc
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/FauxVibrantLight.car
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantLight.car
/System/Library/PrivateFrameworks/SFSymbols.framework/Versions/A/Resources/CoreGlyphsPrivate.bundle/Contents/Resources/Assets.car
/dev/null
/dev/null
/dev/null
->0x36a38c678246d419
/Users/storage/Library/Application Support/Anki2/prefs21.db
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/T/anki3d48292e4d2714f11c2adf276b610971e068a519
->0x36a38c678245fb29
->0x36a38c678245fa61
->0xddc3f749210b60e9
->0xb31cc40367108778
->0xddc3f749210b60e9
localhost:56413
/Users/storage/Library/Application Support/Anki2/Japanese/collection.anki2
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/icudtl.dat
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_resources_100p.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_resources_200p.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_resources.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_devtools_resources.pak
/Applications/Anki.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_locales/en-GB.pak
count=0, state=0x12
count=0, state=0x12
->0x891c6af24820ed43
->0xce25d56c529f7214
count=0, state=0x8
/
/private/etc
/private/etc/hosts
/dev/urandom
count=0, state=0x12
/System/Library/Extensions/AppleMetalOpenGLRenderer.bundle/Contents/Resources/default.metallib
/System/Library/Extensions/AppleMetalOpenGLRenderer.bundle/Contents/Resources/PixelConverter.metallib
count=0, state=0x12
/Users/storage/Library/Application Support/Anki2/Japanese/collection.anki2-wal
->0x36a38c67824611d1
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/net.ankiweb.dtop/com.apple.metal/16777235_322/functions.data
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/net.ankiweb.dtop/com.apple.metal/16777235_322/functions.list
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/net.ankiweb.dtop/com.apple.metal/32023/libraries.data
/private/var/folders/t5/gdvb608s1tzb702msnym486m0000gt/C/net.ankiweb.dtop/com.apple.metal/32023/libraries.list
localhost:56582->localhost:56413
localhost:56583->localhost:56413
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_stdlib.metallib
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_filters.metallib
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_stdlib_stitchable.metallib
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_filters_stitchable.metallib
/Users/storage/Library/Saved Application State/net.ankiweb.dtop.savedState/data.data
/Users/storage/Library/Saved Application State/net.ankiweb.dtop.savedState/windows.plist

You mentioned running without add-ons, so I’m glad you’ve tried that already. What about other things from the Troubleshooting Checklist – Troubleshooting - Anki Manual ?

Yes, I’ve retried all the solution today. The only thing that seems to fix this is switching to the software video driver. After some testing, I’ve figured out what is causing this, the memory leak seams to happen every time a new study card window is rendered (each time clicking a particular deck and pressing study, or after editing a card rendering it in study mode again). Although I saw some high memory usage spikes with the software video driver it didn’t seam as drastic and I could’t find ways to continually reproduce it (although strangely it was using more memory at idle), meanwhile the other two (Metal and OpenGL video drivers had very reproducible memory leaks). I would still consider this a very serious bug as it makes the two more optimized video drivers almost unusable with extended sessions. Guess I’ll use the less optimal software video driver until this bug is resolved.

1 Like