Closed Bug 1983233 Opened 1 year ago Closed 10 months ago

Testcase writing back-and-forth between canvas and webgl seems to do tons of "nursery malloc buffers" with 96% tenuring rate

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Open testcase
Click Run (DO NOT select the checkbox)

Firefox: https://share.firefox.dev/46U1WmV (60s)
Chrome: 50s

We are not much slower than chrome, and this is primarily a gfx thing. But is there anything that seems worthwhile to investigate from JS perspective?

Severity: -- → N/A
Priority: -- → P3

After looking at it a bit, the interesting thing here is that we're getting a whole series of NURSERY_MALLOC_BUFFERS minor GCs, each of which tenures 96%. These are coming because it is allocating tons of typed arrays in the nursery with malloc data, and those allocations are registered with the nursery, and it's the allocations for the registration hashtable that trigger the minor GCs.

Which raises a question: should the nursery's own accounting be triggering nursery collections? At least in this case, it seems like it really ought to be triggering minor GCs based on TOO_MUCH_MALLOC (or maybe OUT_OF_NURSERY). But it's arguable, and nothing is really broken here.

I don't know if reducing these minor GCs would speed things up, but the test case is artificial and stresses memory enough that it doesn't seem worth fixing just for this scenario. It's at least something to watch out for, though: lots of NURSERY_MALLOC_BUFFERS minor GCs, and the memory is being allocated under HashSet<...>::putNew. (And these allocations will almost certainly be swamped by the mallocs that they are tracking, so you need native allocation tracking to see them.)

needinfo? jonco just as an FYI; I mentioned this at our meeting earlier, but tracked it down farther. (I erroneously claimed it was string buffers; it is not.)

Flags: needinfo?(jcoppeard)

This seems to be "fixed" in the latest Nightly - that is, the 96% Tenuring rate and "nursery malloc buffers" are all gone.
Profile: https://share.firefox.dev/3HGQH73 (50s)
Bisection points to https://phabricator.services.mozilla.com/D261113 (Bug 1976558)

Depends on: 1976558

I'll mark this as fixed given comment 2. It looks like the performance is the same as Chrome now and looking at the profile little of the time is related to GC.

Status: NEW → RESOLVED
Closed: 10 months ago
Flags: needinfo?(jcoppeard)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: