Closed Bug 938945 Opened 12 years ago Closed 11 years ago

Investigate if we should gc/cc more during testing

Categories

(Testing :: Mochitest, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(3 files)

Attached patch more_cc_gc.diffSplinter Review
gc/cc scheduling is not optimized for mochitest -like testsuites. In general we try to postpone especially cc if possible in order to not affect to responsiveness. Running tests is very different case. So *maybe* we could explicitly run gc/cc a bit more often. https://tbpl.mozilla.org/?tree=Try&rev=26e62fdcec83
With the patch we have a lot less DOMWindow objects alive at the end of M2, and I don't see Bug 935419 on try.
Comment on attachment 832680 [details] [diff] [review] more_cc_gc.diff Review of attachment 832680 [details] [diff] [review]: ----------------------------------------------------------------- I think this looks reasonable, and we should land it to hopefully help reopen the trees. ::: testing/mochitest/tests/SimpleTest/iframe-between-tests.html @@ +6,5 @@ > load the next. > --> > <script> > window.addEventListener("load", function() { > + var runner = (parent.TestRunner || parent.wrappedJSObject.TestRunner); Nit: no need for the parens
Attachment #832680 - Flags: review?(ted)
Attachment #832680 - Flags: feedback+
Landed https://hg.mozilla.org/integration/mozilla-inbound/rev/c3d8ec0e53c7 Also, shutdown cc is something which is run only in debug builds, and during it we don't do various optimizations, so the graph can be a lot larger than usually. Users don't ever get shutdown CCs.
[13:28] edmorley smaug: ok, let's land and retrigger a load, but not reopen [13:28] smaug right
Do we know what affect this has on mochitest runtimes?
I couldn't see difference when comparing try runs to m-i runs, assuming the information in tooltips is reliable. gc/cc don't after all run too often.
Blocks: 935419
Assignee: nobody → bugs
Component: General → Mochitest
Product: Firefox → Testing
Will this change the behavior of browser-chrome, too, or does some other file have to be modified for that?
This was mochitest only. Ted, could we put the gc/cc triggering to some generic place where it would be called in mochi, browser-chrome and chrome tests
Flags: needinfo?(ted)
This is going to make it so we run a lot fewer incremental GCs during testing. That's bad.
Maybe we could have some kind of special powers function that starts an incremental GC if we're not already in the middle of one? A simpler fix that doesn't regress our IGC testing might be to force a few GC/CC cycles in the test harness right before we shutdown.
(In reply to Andrew McCreight [:mccr8] from comment #10) > Maybe we could have some kind of special powers function that starts an > incremental GC if we're not already in the middle of one? I guess that could work. > A simpler fix that doesn't regress our IGC testing might be to force a few > GC/CC cycles in the test harness right before we shutdown. I don't think that would really help much.
Something like this then? Backs out the previous patch. https://tbpl.mozilla.org/?tree=Try&rev=f324783b0b11
Attachment #832972 - Flags: review?(ted)
Attachment #832680 - Flags: review?(ted)
(In reply to Bill McCloskey (:billm) from comment #11) > > A simpler fix that doesn't regress our IGC testing might be to force a few > > GC/CC cycles in the test harness right before we shutdown. > > I don't think that would really help much. Why wouldn't it? As far as I see the m2 issue is that shutdown CC ends up dealing with a too big graph. We have shutdown CC only on debug builds, and while we're running it, we can't do any CC optimizations (so the graph ends up being so huge). But let's see what tryserver tells us.
(In reply to Olli Pettay [:smaug] from comment #13) > (In reply to Bill McCloskey (:billm) from comment #11) > > > A simpler fix that doesn't regress our IGC testing might be to force a few > > > GC/CC cycles in the test harness right before we shutdown. > > > > I don't think that would really help much. > Why wouldn't it? > As far as I see the m2 issue is that shutdown CC ends up dealing with a too > big graph. I misunderstood what Andrew was saying. I thought he was proposing we do a few incremental GCs during shutdown to get minimal test coverage for it. I guess you're only adding new GCs at the end, which seems fine.
(In reply to Olli Pettay [:smaug] from comment #8) > This was mochitest only. > > Ted, could we put the gc/cc triggering to some generic place where it would > be called in > mochi, browser-chrome and chrome tests No, mochitest and browser-chrome don't really share any JS code unfortunately.
Flags: needinfo?(ted)
Comment on attachment 832972 [details] [diff] [review] only gc/cc right before shutdown Review of attachment 832972 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/mochitest/browser-test.js @@ +194,5 @@ > + let utils = window.QueryInterface(Ci.nsIInterfaceRequestor) > + .getInterface(Ci.nsIDOMWindowUtils); > + utils.garbageCollect(); > + utils.garbageCollect(); > + utils.garbageCollect(); Is there a reason we have to do this three times? Would be nice if we could just say utils.reallyGarbageCollect() or something.
Attachment #832972 - Flags: review?(ted) → review+
One collect may not collect everything. utils.garbageCollect() calls gc then cc. CC's unlink may lead to new garbage to be collectable.
Uh, Win7 debug Moth doesn't like the second patch.
Attached patch v3Splinter Review
Looks like TestRunner has a bug where it calls onComplete twice. https://tbpl.mozilla.org/?tree=Try&rev=f35bcce4e333
Comment on attachment 833179 [details] [diff] [review] v3 ted, is removing - if (TestRunner.repeat == 0 && TestRunner.onComplete) { - TestRunner.onComplete(); - } ok to you. We call onComplete later in the same function. Try is still running...
Attachment #833179 - Flags: review?(ted)
Comment on attachment 833179 [details] [diff] [review] v3 Review of attachment 833179 [details] [diff] [review]: ----------------------------------------------------------------- I'm a little confused about how this repeat logic works, but this *looks* sensible.
Attachment #833179 - Flags: review?(ted) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
(Followups haven't landed)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blocks: MochiMem
Olli, is your followup ready to land? I'm a little nervous about not running IGC as much in Mochitests.
This does seem to have fixed bug 935419, though!
It is not ready to land. It seems that we should run CC reasonable often anyway, not only right before shutdown.
Since we've branched, should this bug be closed and followup work moved to say bug 939606?
Flags: needinfo?(bugs)
Blocks: 949607
There are tests on b2g, like bug 775227, that oom. So on b2g doing more gc/cc (I think even after every test) would be better there. Some of the tests might not oom then.
A patch landed quite a while ago, so I'm going to mark this as fixed. Followup work can go in a new bug.
Status: REOPENED → RESOLVED
Closed: 12 years ago11 years ago
Flags: needinfo?(bugs)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: