Closed Bug 883657 Opened 11 years ago Closed 11 years ago

Don't force a GC in mozJSComponentLoader::UnloadModules()

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25
Tracking Status
firefox24 --- fixed
firefox25 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(2 files)

Bug 881266 revealed that mozJSComponentLoader::UnloadModules() runs JS_DestroyContext(), which forces a GC, right after we shutdown the CC.  This feels archaic.  Just changing this to JS_DestroyContextNoGC() causes tiny shutdown leaks, so probably we need to move UnloadModules() to before we shutdown the CC, then see if we can get away with not forcing a GC.  Note that we still may end up running a GC here unless bug 881309, but it is a start.

Also, once this stuff is cleaned up, it might be worth asserting if the GC ever runs after the CC shuts down.
Let's see how this works.

move unload before CC shutdown: https://tbpl.mozilla.org/?tree=Try&rev=36fda2b321b3
don't force a GC in mozJSComponentLoader::UnloadModules: https://tbpl.mozilla.org/?tree=Try&rev=104b83032368
Both are green in L64 debug.  I suppose I should see if this actually reduces the number of shutdown GCs in opt builds.
Assignee: nobody → continuation
Comment on attachment 766753 [details] [diff] [review]
part 1: call UnloadModules before we shutdown the CC

Review of attachment 766753 [details] [diff] [review]:
-----------------------------------------------------------------

I'm not sure who really knows this code, but it involves shutdown, so maybe you can review this, bsmedberg.
Attachment #766753 - Flags: review?(benjamin)
Comment on attachment 766754 [details] [diff] [review]
part 2: don't force a GC in UnloadModules

With UnloadModules moved before the shutdown GC+CCs, we don't need to force a GC in shutdown to avoid tiny leaks.
Attachment #766754 - Flags: review?(bobbyholley+bmo)
Comment on attachment 766754 [details] [diff] [review]
part 2: don't force a GC in UnloadModules

Review of attachment 766754 [details] [diff] [review]:
-----------------------------------------------------------------

Nice. r=bholley
Attachment #766754 - Flags: review?(bobbyholley+bmo) → review+
Attachment #766753 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/b05165a7a277
https://hg.mozilla.org/mozilla-central/rev/47862004ed14
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Congrats, mccr8! According to a lot of Try bisection and the below Try push (these patches on top of m-b tip), this is what also what made WinXP xpcshell stop timing out all the time.
https://tbpl.mozilla.org/?tree=Try&rev=748c38bed260

Can you please request approval to uplift this to Fx24 so we get this in for the next ESR? :)
Comment on attachment 766753 [details] [diff] [review]
part 1: call UnloadModules before we shutdown the CC

[Approval Request Comment]
Bug caused by (feature/regressing bug #): n/a
User impact if declined: sheriff pain on esr24
Testing completed (on m-c, etc.): missed fx24 by a day, no known regressions
Risk to taking this patch (and alternatives if risky): minimal per mccr8
String or IDL/UUID changes made by this patch: none
Attachment #766753 - Flags: approval-mozilla-beta?
Attachment #766754 - Flags: approval-mozilla-beta?
Comment on attachment 766753 [details] [diff] [review]
part 1: call UnloadModules before we shutdown the CC

low risk well baked, makes sheriff's life easier :) Lets get it on !
Attachment #766753 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #766754 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Assuming no QA needed here. Please remove [qa-] from the whiteboard and add the verifyme keyword if this needs QA.
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: