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

Most upvoted comments

Kk, good job with 0.3.11, I’ll have to find new ways of breaking your app then 😉

The question is not if you find a new way to break the logic, but more when 😃

EDIT: Also, it looked as if the last changes I made seconds before the crash were never implemented. I had to re-delete layouts.

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.

Maybe it’s influenced by rotating the screen a lot?

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.