florisboard: Possible memory leak in keyboard view
Version: 0.3.5 Source: Playstore Android 10 Samsung Galaxy s9
~~~ 1611851663324.stacktrace ~~~
java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 2226872 free bytes and 2174KB until OOM, target footprint 268435456, growth limit 268435456; failed due to fragmentation (largest possible contiguous allocation 46399488 bytes)
at java.lang.StringFactory.newStringFromChars(StringFactory.java:260)
at java.lang.StringBuilder.toString(StringBuilder.java:413)
at dev.patrickgold.florisboard.ime.media.emoji.EmojiKeyData.getCodePointsAsString(EmojiKeyData.kt:40)
at dev.patrickgold.florisboard.ime.media.emoji.EmojiLayoutDataKt.parseRawEmojiSpecsFile(EmojiLayoutData.kt:139)
at dev.patrickgold.florisboard.ime.media.emoji.EmojiKeyboardView$1.invokeSuspend(EmojiKeyboardView.kt:68)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 36 (18 by maintainers)
Commits related to this issue
- Fix memory leaks and reset failures (#267) — committed to florisboard/florisboard by patrickgold 3 years ago
The question is not if you find a new way to break the logic, but more when 😃
Because the shared preference batch together changes to avoid writing to the disk too often, this issue occurs if the keyboard crashes seconds after setting a preference (deleting the subtype is settings a preference value).
Partly, but there are also some issues in some generic dispatcher handles, where I don’t know yet what FlorisBoard method they are actually representing.
Yep this could very likely be the reason of this bug and would explain the layout/emoji data re-parse, as an orientation change causes an internal service re-build.
I’ll do my best to contact you if and when it occurs again.