Closed Bug 1377466 Opened 9 years ago Closed 9 years ago

Reconsider the JS::PokeGC call in XPCRootSetElem::RemoveFromRootSet()

Categories

(Core :: JavaScript: GC, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mccr8, Unassigned)

References

(Blocks 1 open bug)

Details

XPCRootSetElem::RemoveFromRootSet() is called when we destroy various XPConnect data structures that hold alive JS objects. This calls JS::PokeGC, which sets a flag on the JS runtime. (This is the only call to PokeGC.) If that flag is set, and we're in a shutdown or compacting GC, then we do a full GC. This also causes us to do a second GC. Note that this does not affect the GC reason, so I don't think we have any telemetry on how often this happens. It would be nice if we could just schedule a GC for the chrome zone, rather than a full GC. I don't know if XPCWrappedJS can wrap content JS or not. I vaguely remember some horrible reasons we do this poke flag thing, though so maybe not. We may at least want to collect some telemetry on how often the poke flag is affecting the GC.
Depends on: 1380025
Keywords: leave-open
(In reply to Andrew McCreight [:mccr8] from comment #0) We now have a separate reason code for this (bug 1380025) and it now only happens in shutdown GC (bug 1380387). The 'poke' is still necessary to ensure that everything is collected in a shutdown GC. Please reopen if you think there's more to do here.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.