Closed Bug 802372 Opened 13 years ago Closed 13 years ago

[keyboard] load dictionary lazily and discard when not needed

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86
macOS
defect
Not set
normal

Tracking

(blocking-basecamp:-)

RESOLVED FIXED
blocking-basecamp -

People

(Reporter: djf, Assigned: djf)

References

Details

(Whiteboard: QARegressExclude)

According to Andreas, the predictive text dictionary used by the keyboard consumes 5 to 7mb. Since the keyboard is part of the system app, this memory is permanently allocated. So we should be smarter about this, loading the dictionary when the keyboard is first used rather than at start time, and discarding the dictionary when the keyboard has been idle for some amount of time. Nominating as blocking, since it seems like it could be an important performance issue. Andreas, feel free to add your comments about whether this should block or not.
Assignee: nobody → dflanagan
blocking-basecamp: --- → ?
This would be great to see, but this is a risk/reward call that should be made on a patch level. Marking blocking-, please seek driver approval for the patch.
blocking-basecamp: ? → -
And to be clear, all this will need for approval+ is demonstration of nontrivial memory savings in the common case.
Fixed in https://github.com/mozilla-b2g/gaia/pull/6007 (which landed because it fixed other blocking+ bugs, so I didn't get approval to fix this one). Dictionaries are only loaded when needed. If the keyboard is not used for 30 seconds it discards the dictionary. Testing with b2g-desktop, and using Activity Monitor, I could see ~4mb of memory being reclaimed a few seconds after the dictionary was discarded. I have not tested on the device but assume that the memory savings would work there too. Chris: I just guessed at the 30 second idle time. Does that seem reasonable to you? I'm going to mark this resolved, but please reopen if you want me to change the idle time setting.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Until we have a way to measure quantitatively, your guess is as good as mine! :)
In Unagi version 20130114073222, the predictive text dictionary does not disappear after being idle for 30 seconds. Defect 830443 has been created. https://bugzilla.mozilla.org/show_bug.cgi?id=830443
Depends on: 830443
I've closed that new bug as invalid, but see my comments there for an explaination. In order to verify this bug, you have to monitor the memory usage on the phone and see that 30 seconds after the keyboard disappears, the memory usage goes down by 3-5mb. This may not be something you'll be able to verify.
No longer depends on: 830443
Whiteboard: QARegressExclude
You need to log in before you can comment on or make changes to this bug.