question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory Error & No Auto Complete when binary flict is large ~ 6mb

See original GitHub issue

Referring to this feature

I generated a binary flict using the dict-tools for en where size was 6.8 mb – about 3 times the default en binary flict. Size is larger due to more words and the highest dimension for n-grams used was 2. However when file is reduced to a small size, significantly fewer tokens, word-complete works fine.

Short description

Memory runs out when flict is too large

Steps to reproduce

  1. Generate large flict > 6mb
  2. Type an entire paragraph as quickly as possible
  3. No auto-complete will show and keyboard will quickly crash in seconds
  4. See error

Environment information

  • FlorisBoard Version: current main branch, commit 38baac1af92fea80a86f5fdd8850bc677a27a3d2.
  • Install Source: Github
  • Device: Emulator Android Studio
  • Android version, ROM: Android 11
~~~ 1614445172221.stacktrace ~~~

java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available
~~~ 1614445172167.stacktrace ~~~

java.lang.OutOfMemoryError: Failed to allocate a 80 byte allocation with 8 free bytes and 8B until OOM, target footprint 201326592, growth limit 201326592
	at java.util.Arrays.copyOf(Arrays.java:3257)
	at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
	at java.lang.StringBuilder.append(StringBuilder.java:137)
	at dev.patrickgold.florisboard.ime.core.FlorisBoard.onUpdateSelection(FlorisBoard.kt:388)
	at android.inputmethodservice.InputMethodService$InputMethodSessionImpl.updateSelection(InputMethodService.java:906)
	at android.inputmethodservice.IInputMethodSessionWrapper.executeMessage(IInputMethodSessionWrapper.java:104)
	at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7656)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

@patrickgold

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:26 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickgoldcommented, Mar 15, 2021

@tsiflimagas Good to know, thanks for linking!

1reaction
patrickgoldcommented, Feb 27, 2021

Since Luminiso doesn’t support higher n-grams, is fixing the calculation error in flict.py part of phase two work? Or will the solution be more about reducing memory so that large binaries don’t cause a crash?

No the end bug is something I prefer to have included still in phase 1, because it reduces the file size and also reduces the amount of bytes read into memory in runtime when the binary file is cached.

Read more comments on GitHub >

github_iconTop Results From Across the Web

out of memory error while reading binary file
but when I read my binary file I get an out of memory error . I think it is because the fread function...
Read more >
Solved: "Not enough Memory" error while writing a binary file
Problem: When i enable "file write", after writing more than 400000 records (approx), an error message (Not enough memory for the operation) ...
Read more >
java
The java command supports a wide range of options that can be divided into the ... show how to set the size of...
Read more >
Fix list for IBM WebSphere Application Server V7.0
The following is a complete listing of fixes for V7.0 with the most recent fix at ... Install, PI61290, An application error can...
Read more >
Untitled
#sindikat Debora miranda ele nao estava la, Des arc high school football, ... Carmel referral code, Zero g flight europe, Remote utilities 5.3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found