Closed Bug 1406065 Opened 3 years ago Closed 3 years ago

Harmonise GC parameters for different configurations


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

55 Branch





(Reporter: jonco, Assigned: jonco)


(Blocks 1 open bug)



(1 file)

There are different GC parameter settings that are used for the desktop browser, mobile browser (normal and restricted RAM configurations) and the shell.  We should make sure these are set to sensible values and reflect current RAM sizes.
According to snorp, the restricted RAM settings for mobile only apply to ARMv6 devices which are no longer supported.
Here's a spreadsheet showing the current settings:

My main observation from this is that the settings are almost exactly the same across configurations, with the exception of  JSGC_MAX_MALLOC_BYTES, which is much larger on desktop (128 MiB vs 32 MiB everywhere else).
Thanks Jon, This was something I hoped we could imporve and the spreadsheet will be very handy to find all these.
Blocks: 1371162
Priority: -- → P3
Depends on: 1406962
Patch to set the max malloc bytes parameter to 128MiB in the shell, the same as it is in the browser.

This removes the "backward API compatibility"* where this parameter is set to the same value as the max bytes parameter when initialising the GCRuntime and adds a default value of 128MiB, which is what the default browser pref sets ends up setting it to.

* This comment is due to bug 506125. I don't think we try that hard to preserve backward compatibility, and I don't think this change is likely to break things if we did.
Assignee: nobody → jcoppeard
Attachment #8917012 - Flags: review?(sphink)
Comment on attachment 8917012 [details] [diff] [review]

Review of attachment 8917012 [details] [diff] [review]:

\o/ It's a PITA to trace through what these settings are and what they mean. Any simplification is welcome.

::: modules/libpref/init/all.js
@@ +1457,5 @@
>  // js/src/jsgc.cpp.  They're documented in js/src/jsapi.h.
> +// This preference determines the rate at which GCs are triggered by
> +// malloc memory allocation.

Can you add in a mention of the units, somehow? Maybe ", in MB" is enough, or if you want to be fully explicit, "the units are in megabytes of allocations, ignoring frees" or something.
Attachment #8917012 - Flags: review?(sphink) → review+
Pushed by
Make JSGC_MAX_MALLOC_BYTES param the same in the shell as the browser r=sfink
Keywords: leave-open
I'm not sure what else I intended to do in this bug.  If I remember I'll file a new one.
Closed: 3 years ago
Keywords: leave-open
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.