-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Degrading performance with each card reviewed #12980
Comments
It appears my issue is a duplicate of this, the symptoms match: Removing font-family: arial; from my card CSS appears to have resolved the performance issues. It appears I also neglected to mention that I get the same webView crashes after switching to another app without closing AnkiDroid. |
Just to add to my own experience on this issue: I experienced the same problem on a Samsung S8, however, when switching to a Samsung S10 the issue was resolved, but only for a few days. This led me to try to clear all the data for the AnkiDroid via the app preferences, and resyncing my decks. This again solved the problem for me, and I've now been using the app without issue for about a week. I have yet to try to remove |
Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
Still an issue in the beta. Just to add a datapoint. I have experienced this problem for several years, and gave up on it getting fixed. I now do reviews of perhaps a couple-hundred cards, and as I feel things slow down (card-to-card rendering time), I go to the task manager, kill ankidroid and restart the app. It's not uncommon to do this 2 or 3 times per day. Takes about 10 seconds, so I just got used to it. I don't kill the app myself, ankidroid will keep slowing down till it crashes, and certain new-card progress will potentially be lost. (At least in the past, my reviews would be saved, but Ankidroid would 'forget' that I had done 15 of 30 'new' cards for the data, and I'd come back after crash with 30 'new' cards. This may have been fixed. ) I review Japanese. I use two different custom fonts (a pretty handwritten font, and a stroke-order font), in addition to the system Japanese fonts. These are bundled as deck media in the usual anki way. I also have audio on many of the cards, which could figure into things, but a lot of finger-pointing has been done at fonts over the years, so that seems to be the culprit. armchair-quarterbacking, I've long wondered: if the underlying issue is a chrome webview not cleaning up cache, is there not something that Ankidroid could periodically explicitly destroy and recreate just to work around this issue? Is there a chrome cache that cannot be cleared except by terminating all of Anki? I realize this wouldn't feel like a "clean" solution, but clearly whatever google changed, it's been broken for several years and they aren't fixing it. (Other tickets have this tagged as "upstream issue", I guess hoping google will do something...) There was a long period where things worked fine many years ago, then a change in chrome's core webview sparked the issue. There was a small window where it was possible to manually install an older version of the chrome webview component to fix the problem, but that stopped working many, many versions of Android ago. To link together some likely-related issues: As you can see, this keep getting closed and forgotten. #4856 in particular was opened in 2018. Closed as "I'm going to close this because there is nothing we can do, and even when fixed there will be no action to take that I'm aware of. But I have starred the bug upstream and I recommend anyone interested in the resolution to do the same" Here's the upstream chromium ref, whose last comment was in 2019: The last note on #11620 is: If that's the case, it seems that periodically discarding & recreating something could be a workaround. Don't know how hard it would be to do that in a 'seamless' way. |
We need to get a reproduction case: this should be fairly feasible with an emulator I'd then propose resetting the WebView every 50 reviews, and see if this resolves the issue |
I am a developer but I don't do Android development (I'm sure I could get an emulator running locally). Do you think I could just get you a copy of my deck? I imagine tapping "good good good" for a couple of minutes at high speed would reproduce. I can start by stripping the audio (to save space) and reproducing on a spare pixel3a to make sure it should crash before sending something along. I don't have anything I consider private in my actual deck, so no worries there. What do you think? It will take some time, but if you need me to set up an emulator I can do it. You'll need to let me know what I need to get to you. |
I strongly suspect the issue is the font, and the ideal would be to find something GPL-compatible which we could add to the repo. From there, automating the emulator is simple. Right now, I'm snowed under and I won't have the time to take this up. Let's schedule it for 2.18. We've got a ton of people waiting for 2.17, and I'd rather focus efforts towards getting our final blocking bugs fixed. |
No rush. It's been this way for quite a while, I'm pretty excited to see that you're interested in taking it up. I'll try to keep an eye on this ticket for updates, and if there's anything I can provide (with in my means) I will try to help out. |
Same behavior but in my case it crashes every 20 cards or so. This also crashes all other open apps. After the crash every single card gets slower and slower to load. This has been a constant struggle for years and makes the app barely usable.
|
As asked by David, I'm reporting I also have this issue. Here's my original message posted on another social: Device: OnePlus 10T 5G (8GB of RAM) When I use the app, after roughly 10 minutes it slowly slows down, becoming more and more sluggish until it eventually freeze completely. The system becomes unresponsive and I'm stuck in the Anki frozen screen. After some time (about a minute) it crashes. Sometimes the toast message "WebView out of memory" (or something similar, I didn't memorize it) pops up. The cards are pure text, no media of any kind included, but it does use a third-party font, and I've used the same deck on a different device (an older Asus) and it worked flawlessly without any issue. (But it also used an older AnkiDroid version) My device has no issues with any other application, including intensive 3D videogames. As other users said, while freezing the phone is indeed an issue, I've became accustomed to terminate the app as soon as it slows down, so ultimately I have established a habit of fixing it manually, but if this issue could be solved it would help a lot. AnkiDroid Version = 2.20.0 (d41d16a) Backend Version = 0.1.48-anki24.11 (24.11 c47638ca36f99dd4f3b81ae82d964aec66e392e0) Android Version = 14 (SDK 34) ProductFlavor = play Manufacturer = OnePlus Model = CPH2415 Hardware = qcom Webview User Agent = Mozilla/5.0 (Linux; Android 14; CPH2415 Build/UKQ1.230924.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.41 Mobile Safari/537.36 ACRA UUID = 181c0e00-d376-4a08-a338-7af29d2c7cb8 FSRS = 1.4.3 (Enabled: true) Crash Reports Enabled = true |
@BrayanDSO would you accept a patch to reinit the WebView every ~50 cards or so for the new Reviewer? |
I don't know if that also happens there. The new reviewer is only recreated in some System configuration changes, which is way way less than the legacy reviewer, that recreates it in every card (I don't recall if it happens when flipping a card as well). Maybe that's a problem with how the old instances are garbage collected. If it happens there and (ideally) we have a reproduction case, I'd be fine with reinitializing the webview based on some kind of parameter if that really can fix the issue. The legacy reviewer does that in every card and the issue still exists. For now, I suggest waiting for a confirmation. |
I wasn't aware that the WebView was reinitialized on each card load, I thought it was a page load That being said: @amadareRythm Could you
|
@david-allison Sure thing. I've just enabled the New Reviewer and will report back tomorrow after my daily study session. |
I did my study session with the new reviewer and, for the first time since I don't know how much, it didn't had the problem. It's only one singular test so it might have been just a coincidence. Still, it's promising. I'll test for another week and report back. |
Another positive datapoint @david-allison I had no unexpected problems during the reviews. The new reviewer looks and feels nice, and for the most part I barely noticed any difference vs. the classic card reviewer. Two non-trivial notes just in case:
And a more minor observation:
Old/Current Margins (I crammed as much in as I could) Thanks as always. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
After thousands of reviews, I can confidently say this is the first time in years I've experienced responsive card flipping. As a dedicated AnkiDroid user, this update is easily one of the best things to happen to me in 2024. Absolutely incredible work, I'm beyond grateful! |
After a whole week of use and thousands of reviews I can confirm as well that the problem seems fixed. I'm so glad the problem has been already solved, plus, I really like the design of the new reviewer. Thank you all to the people involved, I love AnkiDroid and this issue was a real nuisance, slowing down every study session. Now, I can focus more on the study AND finish earlier than before. Thanks again. |
I've recently started to have serious issues with reviews becoming unbearably slow in the app. It seems to clear if I restart the app, but reappears gradually as I review. The result is a consistent full second delay after pressing to view the answer and pressing good. Outside of reviews, performance on my phone is smooth and responsive. Issue only cropped up in the last week. Possibly related to a recent WebView for Android update.
Edit: Discovered that just leaving the deck review and re-entering resets the lag build-up. Memory leak?
Update: The latest WebView patch reduced the severity of the issue, but the behaviour remains. Performance degrades gradually with each card reviewed until I close and reopen the deck.
Reproduction Steps
Expected Result
Reasonable performance.
Actual Result
Consistent one second latency on every button press during reviews.
Debug info
Refer to the support page if you are unsure where to get the "debug info".
AnkiDroid Version = 2.15.6
Android Version = 12
Manufacturer = Sony
Model = XQ-BT52
Hardware = qcom
Webview User Agent = Mozilla/5.0 (Linux; Android 12; XQ-BT52 Build/62.1.A.0.675; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/108.0.5359.79 Mobile Safari/537.36
ACRA UUID = 90492a50-8790-49c3-a61a-c6b5cf661452
Scheduler = std
Crash Reports Enabled = true
DatabaseV2 Enabled = true
Research
Enter an [x] character to confirm the points below:
The text was updated successfully, but these errors were encountered: