Closed Bug 934001 Opened 11 years ago Closed 11 years ago

ImageView's setImageBitmap is evil

Categories

(Firefox for Android Graveyard :: Theme and Visual Design, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox27 fixed, firefox28 fixed)

RESOLVED FIXED
Firefox 28
Tracking Status
firefox27 --- fixed
firefox28 --- fixed

People

(Reporter: sriram, Assigned: sriram)

Details

(Keywords: perf)

Attachments

(1 file)

Calling setImageBitmap(null) creates BitmapDrawables, BitmapDrawable$State, and associated Paint objects. That's so much memory for not showing anything! :O
Attached patch PatchSplinter Review
Feels so light.
Attachment #826153 - Flags: review?(mark.finkle)
Keywords: perf
Comment on attachment 826153 [details] [diff] [review]
Patch

We should find a way to get this kind of code change documented so other people remember it. Maybe a simple post to mobile-dev-firefox? Just a short paragraph on why setImageBitmap(null) is not as good as setImageDrawbale(null).

I thought there was another issue with setImageBitmap(null)/setImageDrawable(null) too?
Attachment #826153 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/04066e075f59
Assignee: nobody → sriram
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 28
Do we want to uplift this? Seems trivial.
Flags: needinfo?(mark.finkle)
Comment on attachment 826153 [details] [diff] [review]
Patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Favicon refactor
User impact if declined: Memory and jank issues
Testing completed (on m-c, etc.): It's been on m-c for a while
Risk to taking this patch (and alternatives if risky): low, low risk
String or IDL/UUID changes made by this patch: none
Attachment #826153 - Flags: approval-mozilla-aurora?
Flags: needinfo?(mark.finkle)
Aurora is 28 as of today. Is this good enough to take for beta?
Comment on attachment 826153 [details] [diff] [review]
Patch

IMO, yes. Totally safe one-liner.
Attachment #826153 - Flags: approval-mozilla-aurora? → approval-mozilla-beta?
Attachment #826153 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: