The default bug view has changed. See this FAQ.

GC: More GC zeal options

RESOLVED FIXED in mozilla8



JavaScript Engine
6 years ago
6 years ago


(Reporter: billm, Assigned: KWierso)



Firefox Tracking Flags

(Not tracked)


(Whiteboard: mentor=billm)


(1 attachment)



6 years ago
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

6 years ago
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

6 years ago
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

6 years ago
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.
Attachment #547197 - Flags: review?(wmccloskey)

Comment 4

6 years ago
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?
Attachment #547197 - Flags: review?(wmccloskey) → review+

Comment 5

6 years ago
I don't have checkin powers.


6 years ago
Keywords: checkin-needed
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!
Assignee: general → kwierso
Keywords: checkin-needed
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8

Comment 8

6 years ago
I never touched the mark stack side of this bug, should this be reopened or should a new bug be filed for those?


6 years ago
Blocks: 673551

Comment 9

6 years ago
I filed bug 673551 for the mark stack size stuff.
You need to log in before you can comment on or make changes to this bug.