Closed
Bug 669346
Opened 13 years ago
Closed 13 years ago
Don't force a second GC on memory pressure
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 8
People
(Reporter: justin.lebar+bug, Unassigned)
Details
(Whiteboard: [inbound][qa?])
Attachments
(1 file)
5.76 KB,
patch
|
mfinkle
:
review+
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
mobile/chrome/content/browser.js forces a GC [1] when it detects memory pressure. But nsJSEnvironment.cpp already does this [2]. Should I modify [3] so it still forces a GC? Or should I leave it to unload all tabs and just change the dump? (You can now force a gc through about:memory.) [1] http://hg.mozilla.org/mozilla-central/file/4a74ff2faa69/mobile/chrome/content/browser.js#l2531 [2] http://hg.mozilla.org/mozilla-central/file/4a74ff2faa69/dom/base/nsJSEnvironment.cpp#l203 [3] http://hg.mozilla.org/mozilla-central/file/4a74ff2faa69/mobile/chrome/content/browser.js#l100
Reporter | ||
Updated•13 years ago
|
OS: Linux → All
Hardware: x86_64 → ARM
Comment 1•13 years ago
|
||
(In reply to comment #0) > mobile/chrome/content/browser.js forces a GC [1] when it detects memory > pressure. But nsJSEnvironment.cpp already does this [2]. > > Should I modify [3] so it still forces a GC? Or should I leave it to unload > all tabs and just change the dump? (You can now force a gc through > about:memory.) > > [1] > http://hg.mozilla.org/mozilla-central/file/4a74ff2faa69/mobile/chrome/ > content/browser.js#l2531 This will destroy browser elements before doing the GC. We want to make sure we destroy as much as possible before GC'ing. > [2] > http://hg.mozilla.org/mozilla-central/file/4a74ff2faa69/dom/base/ > nsJSEnvironment.cpp#l203 If we only allow this GC, the destroyed <browser>s may not be reclaimed ASAP, right? > [3] > http://hg.mozilla.org/mozilla-central/file/4a74ff2faa69/mobile/chrome/ > content/browser.js#l100 Depends on the answer above
Reporter | ||
Comment 2•13 years ago
|
||
> If we only allow this GC, the destroyed <browser>s may not be reclaimed ASAP,
> right?
Ah, I see. That's correct.
It's still kind of silly to gc twice. I wonder what's the right fix here...
Reporter | ||
Comment 3•13 years ago
|
||
I wonder: Do we even know that those browsers are immediately collected when we do the GC? In bug 664642, I found that I needed to spin the event loop before I GC'ed in order for it to have an effect [1]. (But I was in content, and I was collecting an ArrayBuffer...) I'm not sure what is the right way to communicate to nsJSEnvironment that we don't want it to gc on memory pressure. I could use a pref... [1] https://bug664642.bugzilla.mozilla.org/attachment.cgi?id=540532
Reporter | ||
Comment 4•13 years ago
|
||
> I'm not sure what is the right way to communicate to nsJSEnvironment that we
> don't want it to gc on memory pressure. I could use a pref...
bz, do you have any suggestions here?
Comment 5•13 years ago
|
||
A pref (with a cache to avoid getting prefs on memory pressure) sounds just fine to me.
Reporter | ||
Comment 6•13 years ago
|
||
Attachment #544535 -
Flags: review?(mark.finkle)
Comment 7•13 years ago
|
||
Comment on attachment 544535 [details] [diff] [review] Patch v1 The mobile changes look good to me. The end result will do what we want it to do. You'll need someone else to review the nsJSEnvironment part though. Maybe jst ? r+ for mobile parts
Attachment #544535 -
Flags: review?(mark.finkle) → review+
Reporter | ||
Comment 8•13 years ago
|
||
Comment on attachment 544535 [details] [diff] [review] Patch v1 bz already has his head in this bug -- do you mind, Boris?
Attachment #544535 -
Flags: review?(bzbarsky)
Comment 9•13 years ago
|
||
Comment on attachment 544535 [details] [diff] [review] Patch v1 This looks fine except for the pref name. It's not really a javascript.options, pref, it's a DOM pref, no? I guess it doesn't matter that much... Maybe change it to javascript.options.automatically_gc_on_memory_pressure?
Attachment #544535 -
Flags: review?(bzbarsky) → review+
Reporter | ||
Comment 10•13 years ago
|
||
> Maybe change it to javascript.options.automatically_gc_on_memory_pressure?
How about
javascript.options.gc_on_memory_pressure
?
Comment 11•13 years ago
|
||
That seems fine.
Reporter | ||
Comment 12•13 years ago
|
||
inbound: http://hg.mozilla.org/integration/mozilla-inbound/rev/78509271aa68
Whiteboard: [inbound]
Comment 13•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/78509271aa68
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 8
Updated•13 years ago
|
Whiteboard: [inbound] → [inbound][qa?]
You need to log in
before you can comment on or make changes to this bug.
Description
•