Open
Bug 625155
Opened 15 years ago
Updated 1 year ago
Alter GC heuristics when browser not focused
Categories
(Core :: JavaScript: GC, enhancement)
Core
JavaScript: GC
Tracking
()
NEW
People
(Reporter: wes, Assigned: smaug)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
|
5.28 KB,
patch
|
Details | Diff | Splinter Review |
As we move further and further into long delays between runs of the cycle collector and JSAPI garbage collector, we run the risk of producing a browser which consumes more RAM than it needs to, as well as increasing our fragmenation.
If we kick off a run of the GC and CC when the browser loses focus, we can reclaim some memory when the user isn't needing interactive behaviour.
Game system emulators, Flight of the Navigator, Defender of the Favicon, AJAX long poll apps, etc, can all generate plenty of churn objects when the browser is not focused, but we don't need to make the frame-rate/memory-usage trade-off when the browser isn't focused. So we could potentially restore some functionality (like calling JS_MaybeGC, or reducing the JSAPI GC threshold) when that is the case. That way the browser will be more likely to not need immediate GC when the user requires interaction again.
Similarly, if we have per-tab GC, we can be slightly more aggressive with GC at the expense of framerate for tabs that are not visible, etc.
| Assignee | ||
Comment 1•15 years ago
|
||
We could perhaps do something simple even for FF4.
Call CC let's say 10 seconds after the FF was deactivated (no FF window focused).
And perhaps we could increase the possibility for GC and CC when
FF isn't focused.
| Assignee | ||
Updated•15 years ago
|
Product: Firefox → Core
QA Contact: general → general
| Assignee | ||
Updated•15 years ago
|
Attachment #503292 -
Flags: review?(jst)
| Assignee | ||
Updated•15 years ago
|
Attachment #503292 -
Flags: review?(jst)
| Assignee | ||
Comment 3•15 years ago
|
||
Over a patch I'm going to attach to bug 624549.
Attachment #503292 -
Attachment is obsolete: true
Attachment #506462 -
Flags: review?(jst)
Comment 4•15 years ago
|
||
Comment on attachment 506462 [details] [diff] [review]
patch
+ mAfterDeactivationTimer->InitWithFuncCallback(DeactivationTimerFired,
+ nsnull, 2500,
+ nsITimer::TYPE_ONE_SHOT);
What made you change your mind from 10s to 2.5s?
| Assignee | ||
Comment 5•15 years ago
|
||
There is the user interactivity timer, which would fire "inactive" and that *might* cause CC (without GC). I think we just want to have a proper CC+GC when
FF is deactivated. That is a bit hackish, and should be documented somewhere.
| Assignee | ||
Comment 6•15 years ago
|
||
Comment on attachment 506462 [details] [diff] [review]
patch
I need to update this.
I still think we want something like this.
Attachment #506462 -
Flags: review?(jst)
| Comment hidden (off-topic) |
Comment 8•4 years ago
|
||
Sorry, there was a problem with the detection of inactive users. I'm reverting the change.
Assignee: nobody → smaug
Updated•3 years ago
|
Severity: normal → S3
Updated•3 years ago
|
Component: General → JavaScript: GC
Updated•1 year ago
|
Blocks: GC.performance
You need to log in
before you can comment on or make changes to this bug.
Description
•