Closed Bug 1917397 Opened 3 months ago Closed 2 months ago

Nightly spends tons of time (14s) around MinorGC on an online JSON-to-HTML converter (followup from bug 1864862)

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: mayankleoboy1, Assigned: jonco)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files)

This is same as bug 1864862, with a minor difference: You need to run the demo a second time immediately after the first run completes and the page is clickable.

STR:

  1. Go to https://www.textcompare.org/json/json-to-html/
  2. Paste the sample JSON into the input box
  3. Click on "Process" --> Be alert after this step
  4. Very Imp: As soon as the page is clickable again. click on "Process" again

AR: https://share.firefox.dev/3MCtJg6 , https://share.firefox.dev/3XfP0kL , https://share.firefox.dev/3AWbM9V

14s of time around MinorGC.
Maybe something to improve?

Attached file about:support

This is a regression.
Bisection:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=c715b86068059bd614e2bac57bba333b46b090e0&tochange=291d187ba249c56d5c9dc88b5faaf04db2afe9c1
Suspect: bug 1892242 . However, I set javascript.options.mem.nursery.max_kb = 16384 and I could still repro.

Severity: -- → N/A
Priority: -- → P3
Assignee: nobody → jcoppeard

This adds an AutoSelectGCHeap in SplitHelper so that substrings are allocated
in the tenured heap if we trigger a minor GC.

Also this allocates the result array up front to avoid having to copy the
elements for large arrays.

The profile still shows some long minor GCs with the patch applied but it should help.

Keywords: leave-open
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/adb5d1c3cf7c Tenure substrings in String.prototype.split where appropriate r=jandem

Profile with the latest Nightly:

  1. Run the demo thrice: https://share.firefox.dev/47oCUuk
  2. Continue with the run#1, manually trigger "free memory", then run the demo thrice: https://share.firefox.dev/4d0h41v

Profile looks good. (Browser is maybe maybe retaining memory that is not released even after manually doing "free memory". But this may be an existing behaviour. The browser behaviour is quite variable. Sometimes it retains 1.8GB memory, sometimes it can retain upto 3.8GB)

Attached file memory-report.json.gz

run the demo 3 times, then wait, then manually trigger "free memory"

Attached file memory-report.json2.gz

Continue with the previous demo run (i.e. tab is not closed)
Run the demo thrice, wait, manually trigger "free memory", dump the memory report.

Sorry, I didnt mean to derail this bug with vague/potentially pre-existing memory bugs.
Please feel free to ignore all of that. I am happy with the fix to the minorGC issue.

Blocks: 1920477

I've forked bug 1920477 for followup investigation of remaining issues and will close this one.

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: