Closed Bug 1915328 Opened 1 year ago Closed 1 year ago

Temporary 2.8GB memory spike on a slightly modified Codepen demo

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox129 --- unaffected
firefox130 --- wontfix
firefox131 --- wontfix
firefox132 --- verified
firefox133 --- verified

People

(Reporter: mayankleoboy1, Assigned: jandem)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached file index.html

Open the attched slightly modified testcase (Original at https://codepen.io/yuanchuan/pen/PorpjOQ)

AR: Memory spikes to 2.8GB during loading. However the additional memory is release after a few seconds or if you put the testcase in a background tab. Found out by watching the Windows Task manager for memory use.
ER: Prior to the regression, the memory use never went over 300MB-600MB

Bisection:
Bug 1907891 part 2 - Create shared string buffer for long strings allocated by js::StringBuffer. r=sfink,emilio
Differential Revision: https://phabricator.services.mozilla.com/D216694

(Some regressions may be inevitable based on https://bugzilla.mozilla.org/show_bug.cgi?id=1910420#c6)

Profile1: https://share.firefox.dev/4dwulzP (the blip at the 9.5s mark is when the 2.5GB memory was released)
Profile2 with memory tracking: https://share.firefox.dev/4cEhGcZ
Profile3 with a "40x40" grid size: https://share.firefox.dev/4cImu0M . My machine probably hit some RAM limit in this case.


You can also look at this demo to see a testcase which has become slower post-regression. Every 2 seconds the demo refreshes. During refresh the memory use is high, and it takes longer to refresh compared to pre-regression.
Profile4: https://share.firefox.dev/4fUJfkW

Set release status flags based on info from the regressing bug 1907891

:jandem, since you are the author of the regressor, bug 1907891, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

On a slight tangential note, for similar demo the profiler shows that the memcopy and vector stuff as "ion" time. (Shouldn the category be consistent with the profiles in comment #2 and comment #1?)
https://codepen.io/yuanchuan/pen/QWQzbzb : https://share.firefox.dev/3X6rsyu / https://share.firefox.dev/3Z4NkwW

deleted

Great find. Thanks Mayank.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED

This lets us trigger a minor GC if we're allocating many long strings. This avoids
a memory spike on the test case reported in the bug.

Flags: needinfo?(jdemooij)
Attachment #9421243 - Attachment description: Bug 1915328 - Update mallocedBufferBytes for string buffers usused by nursery strings. r?jonco! → Bug 1915328 - Update mallocedBufferBytes for string buffers used by nursery strings. r?jonco!

Set release status flags based on info from the regressing bug 1907891

Blocks: sm-runtime
Severity: -- → S3
Priority: -- → P1

Mayank, just a heads-up that this might revert some of the changes on JetStream because this makes us match the previous behavior better.

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39e5feb1b0b8 Update mallocedBufferBytes for string buffers used by nursery strings. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

The patch landed in nightly and beta is affected.
:jandem, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox131 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(jdemooij)

This is fixed for me in the latest Nightly. The memory never went over 200MB-300MB.
Profile (30x30 grid) just for reference: https://share.firefox.dev/3XsOVvj
Profile (40x40 grid): https://share.firefox.dev/3Zd2IaF

Status: RESOLVED → VERIFIED

(In reply to Jan de Mooij [:jandem] from comment #8)

Mayank, just a heads-up that this might revert some of the changes on JetStream because this makes us match the previous behavior better.

23.8% regression on Jetstream2-espree-wtb-Average and other espree tests

Flags: qe-verify+

I was able to reproduce the issue on Win11x64 using FF build 131.0a1(2024-08-30).
Verified as fixed on Win11x64 using FF build 132.0b2 and 133.0a1.

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

Attachment

General

Creator:
Created:
Updated:
Size: