Closed Bug 1841254 Opened 3 years ago Closed 2 years ago

A Codepen demo can take 5GB+ memory use that reduces after 30s of CC

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1857617

People

(Reporter: mayankleoboy1, Unassigned)

References

()

Details

Attachments

(2 files)

Go to https://codepen.io/jshawl/pen/dpbzxO
Enter "5000" in the input and click anywhere inside the demo

AR:

  1. 5GB+ memory use. If you take a about:memory report, almost all of that is in heap-unclassified.
  2. It takes a long time to process. Chrome is much faster and hardly uses 300MB RAM.

If you go to about:memory and reduce memory, the memory does reduce.
This is not a recent regression and I can repro this on a build from 2017.

Caveat: The "testcase" and the unintended input value of 5000 seem highly artificial.

Profile: https://share.firefox.dev/431fdUV

Attached file memory-report.json.gz —

Look at PID-3088

Component: Layout → DOM: Core & HTML

this may probably end up being a silly testcase, so feel to resolve as WONTFIX.

Latest profile : https://share.firefox.dev/45Wx6aw
Now, the memory usage increases to 6GB+, but after 27seconds of cycle collection, it reduces to 300MB.

Summary: A Codepen demo can take 5GB+ memory use and almost all of it is heap-unclassified → A Codepen demo can take 5GB+ memory use that reduces after 30s of CC

If I'm not mistaken this issue is the same as Bug 1857617. Each call to .innerHTML parses the text as DOM tree and adds it to the node's children (.innerHTML is rather heavy weight). However, Cycle Collection does not run, therefore memory piles up.

I'll close this as a duplicate, let's continue the discussion over in Bug 1857617. Sound good?

Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1857617
Resolution: --- → DUPLICATE

Thanks for the quick analysis.

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

Attachment

General

Creator:
Created:
Updated:
Size: