Closed Bug 1684982 Opened 3 years ago Closed 3 years ago

XRE_mainRun holds autorelease objects indefinitely

Categories

(Core :: Widget: Cocoa, defect)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

Details

(Keywords: perf-alert)

Attachments

(2 files, 2 obsolete files)

XRE_mainRun makes many calls before invoking appStartup->Run() and entering the event loop. Failing to individually account for these objects leads to memory bloat like we see in Bug 1684903. We could avoid holding this memory if this function creates and drains its own autorelease pool before entering the event loop.

See Also: → 1684903

This method is useful for cases when the pool is filled up within a long-
lasting scope.

The scoped MacAutoreleasePool object will also behave as intended for any
early exits in this function, though none currently exist for macOS code.

Depends on D100733

Attachment #9195325 - Attachment description: Bug 1684982 Part 2: Make XRE_mainRun create a macos autorelease pool before entering the event loop. → Bug 1684982 Part 3: Make XRE_mainRun create a macos autorelease pool before entering the event loop.
Attachment #9195331 - Attachment is obsolete: true
Attachment #9195323 - Attachment is obsolete: true

This scope will support later functional changes that are conditionally
compiled. This part is standalone to help with blame-tracking.

Attachment #9195325 - Attachment description: Bug 1684982 Part 3: Make XRE_mainRun create a macos autorelease pool before entering the event loop. → Bug 1684982 Part 2: Make XRE_mainRun create then destroy a macOS autorelease pool before entering the event loop.
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/877461dd6c4f
Part 1: Add a scope to XRE_mainRun. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/7dc6ee63d69a
Part 2: Make XRE_mainRun create then destroy a macOS autorelease pool before entering the event loop. r=jrmuizel
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

== Change summary for alert #28345 (as of Thu, 07 Jan 2021 09:06:57 GMT) ==

Improvements:

Ratio Suite Test Platform Options Absolute values (old vs new)
6% startup_about_home_paint startup_about_home_paint windows10-64-shippable e10s stylo 687.42 -> 647.58

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28345

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: