Closed
Bug 1382072
Opened 7 years ago
Closed 7 years ago
PublicSuffixPatterns allocates 0.58 MB static object, EXACT: determine how to handle
Categories
(Firefox for Android Graveyard :: General, enhancement)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: mcomella, Unassigned)
Details
(Whiteboard: [mobileAS] 1.26)
Attachments
(1 file)
(deleted),
image/png
|
Details |
PublicSuffixPatterns reads a text file into memory and leaves it there statically, allocating ~0.58 MB (see attached screenshot).
For context, iirc, top sites allocated ~8MB when it opened (from when I was viewing an empty web page) going from ~26.5 MB to ~34.32 MB (visible to AS).
I imagine 0.58 MB is similar in size to the images we put on Activity Stream so it may not be significant to worry about. Also, I don't think it'd be worth the code complexity to make it more efficient.
This bug is just to make sure there is a record of this decision.
Sebastian, do you think this is worth worrying about?
One change I think is worth making is deallocating it on memory pressure.
Reporter | ||
Updated•7 years ago
|
Flags: needinfo?(s.kaspari)
Comment 1•7 years ago
|
||
(In reply to Michael Comella (:mcomella) from comment #0)
> Sebastian, do you think this is worth worrying about?
I think that's okay. Do you have an idea how we could do this differently?
(In reply to Michael Comella (:mcomella) from comment #0)
> One change I think is worth making is deallocating it on memory pressure.
I think I considered that in the past. A problem here might be that top sites is displayed quite often. Dropping this under memory pressure and then reloading it soon after again might not be helpful?
Flags: needinfo?(s.kaspari)
Reporter | ||
Comment 2•7 years ago
|
||
> I think that's okay. Do you have an idea how we could do this differently?
PublicSuffixPatterns could allocate the data when it's constructed and the memory can get GC'd when it's GC'd. Then we just pass the PublicSuffixPatterns instance into the PublicSuffix calls we need to make with it – this can get messy given the current code structure though, especially when we might dereference it to deallocate it.
We wouldn't want to allocate EXACT more than once though, so we'd have to come up with a strategy such that either there is one PublicSuffixPattern instance that's shared or that all PublicSuffixPattern instances share EXACT, but once they are no longer reference, EXACT is deallocated.
All this complexity is why I think it's not worth it. :)
> Dropping this under memory pressure and then reloading it soon after again might not be helpful?
A very good point! :)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Reporter | ||
Comment 3•7 years ago
|
||
I'm just going to set this to the current iteration because it's something we discussed during said iteration.
tracking-fennec: ? → ---
Whiteboard: [mobileAS] → [mobileAS] 1.26
Assignee | ||
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•