Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 661690 - GC: More GC zeal options
: GC: More GC zeal options
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla8
Assigned To: Wes Kocher (:KWierso)
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 673551
  Show dependency treegraph
Reported: 2011-06-02 15:29 PDT by Bill McCloskey (:billm)
Modified: 2011-07-22 14:26 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Add GCZeal options (2.35 KB, patch)
2011-07-20 12:11 PDT, Wes Kocher (:KWierso)
wmccloskey: review+
Details | Diff | Splinter Review

Description Bill McCloskey (:billm) 2011-06-02 15:29:24 PDT
In bug 650978, Gregor suggested that we should have about:config options for GC zeal frequency, and for whether GC zeal GCs are compartment GCs or not.

Also, Igor has suggested that we should have some sort of option for controlling the GC mark stack sizes. This way we could artificially trigger delayed marking.

This would be a good first bug. The about:config options are controlled by dom/base/nsJSEnvironment.cpp. The actual zeal setting is done via JS_SetGCZeal. The mark stack sizes are set with constants like OBJECT_MARK_STACK_SIZE in js/src/jsgc.h. These would need to become options that could be set from the command line, and also maybe from about:config. The command-line parsing for the JavaScript shell is done in js/src/shell/js.cpp.
Comment 1 Josh Matthews [:jdm] 2011-06-13 07:32:19 PDT
Bill, it would be good to state specifically what the goals of this bug are for new contributors. A list of expected prefs would be an excellent first step for that.
Comment 2 Bill McCloskey (:billm) 2011-06-13 10:21:05 PDT
OK. We currently have javascript.options.gczeal, which sets the number passed to JS_SetGCZeal, which is documented here.
This function now has two new parameters, frequency and compartment. It would be nice if we had these two about:config options so we could set them:
  javascript.options.gczeal.frequency (an integer)
  javascript.options.gczeal.compartment_gc (a boolean)

In addition, it would be nice to have these parameters to control the mark stack size:
These would all be integers. They would be used in place of constants, like 
OBJECT_MARK_STACK_SIZE, that are defined in jsgc.h.
Comment 3 Wes Kocher (:KWierso) 2011-07-20 12:11:49 PDT
Created attachment 547197 [details] [diff] [review]
Add GCZeal options

So would something like this be what was wanted for the GCZeal options? My C++ is a bit rusty.
Comment 4 Bill McCloskey (:billm) 2011-07-20 14:56:45 PDT
Comment on attachment 547197 [details] [diff] [review]
Add GCZeal options

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

Looks great, thanks! Are you able to check in?
Comment 5 Wes Kocher (:KWierso) 2011-07-20 14:58:58 PDT
I don't have checkin powers.
Comment 6 Boris Zbarsky [:bz] (still a bit busy) 2011-07-21 14:36:42 PDT
Please put metadata in the patch if you ask someone to push it for you....

I've taken a guess in this case.  Thanks for the patch!
Comment 7 :Ehsan Akhgari (Away Oct 25 - Nov 9) 2011-07-22 14:10:52 PDT
Comment 8 Wes Kocher (:KWierso) 2011-07-22 14:15:46 PDT
I never touched the mark stack side of this bug, should this be reopened or should a new bug be filed for those?
Comment 9 Bill McCloskey (:billm) 2011-07-22 14:26:50 PDT
I filed bug 673551 for the mark stack size stuff.

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