Optimize requestUiThreadCallback
Categories
(GeckoView :: General, defect)
Tracking
(firefox161 fixed, firefox162 fixed)
People
(Reporter: m_kato, Assigned: m_kato)
References
(Blocks 1 open bug)
Details
Attachments
(2 external files)
| Assignee | ||
Comment 1•14 days ago
|
||
When posting a Runnable task to the Android UI thread, we use
GeckoThread.requestUiThreadCallback(). Finally, RunAndroidUiTasks
will be called to run tasks in the queue. requestUiThreadCallback() is
called multiple times, and then postDelayed() is called multiple times
too, even if we have already scheduled a task to run
RunAndroidUiTasks. This is not necessary, and we can optimize it by
only calling postDelayed() once.
Android 17's new concurrent message queue always allocates a Message
object, not recycling it. So we should avoid calling postDelayed()
multiple times to reduce memory allocation.
Comment 3•12 days ago
|
||
| bugherder | ||
Comment 4•11 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: There is a lot of OOM crash by
Message.obtainwith Android 17. This fix reduces to allocate Message object. This will occur when the Android UI thread is busy. - Code covered by automated testing?: unknown
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Before this fix, we always dispatch a task to Android UI thread. But after this, we don't dispatch a task if any task is already queued.
- String changes made/needed?: No
- Is Android affected?: yes
| Assignee | ||
Comment 5•11 days ago
|
||
When posting a Runnable task to the Android UI thread, we use
GeckoThread.requestUiThreadCallback(). Finally, RunAndroidUiTasks
will be called to run tasks in the queue. requestUiThreadCallback() is
called multiple times, and then postDelayed() is called multiple times
too, even if we have already scheduled a task to run
RunAndroidUiTasks. This is not necessary, and we can optimize it by
only calling postDelayed() once.
Android 17's new concurrent message queue always allocates a Message
object, not recycling it. So we should avoid calling postDelayed()
multiple times to reduce memory allocation.
Original Revision: https://phabricator.services.mozilla.com/D341244
Updated•11 days ago
|
Updated•11 days ago
|
Description
•