Open Bug 1768023 Opened 2 years ago Updated 2 years ago

A rogue script using postMessage in a loop makes the browser use more and more memory

Categories

(Core :: DOM: postMessage, defect, P3)

defect

Tracking

()

Performance Impact none

People

(Reporter: julienw, Unassigned)

Details

Attachments

(1 file)

Attached file postmessage.html (deleted) —

From Bug 1291905:

  1. Open the attachment.

=> The browser takes more and more memory.
=> Other pages can be janky because of that.

Here is a profile from my computer: https://share.firefox.dev/3kPzTLT

The fact that we use more and more memory seems strange to me.

Hmm, there seem to be some GCing at the end of the profile, but memory continues to increase. Probably we should let run it for longer to see if we really leak, absolute numbers of used memory are not too high here.

Severity: -- → S3
Priority: -- → P3

One needs GC/CC to run to delete the objects. And since the example is making main thread busy, idle runnables don't run but we fallback to timers. Locally I see memory staying between 100 and 320MB.

I don't think this should be tracked as performance bug. Web pages have tons of way to create lots of garbage.
We could tweak some heuristics to trigger GC/CC sooner, but the testcase is totally artificial, so the testcase itself isn't a good reason to do it.

Performance Impact: ? → -

Note that there was a real page in bug 1291905 (although a benchmark page), but it doesn't exist anymore.

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

Attachment

General

Created:
Updated:
Size: