The default bug view has changed. See this FAQ.

GC: More GC zeal options

RESOLVED FIXED in mozilla8

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: billm, Assigned: KWierso)

Tracking

unspecified
mozilla8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: mentor=billm)

Attachments

(1 attachment)

(Reporter)

Description

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.
(Reporter)

Comment 2

6 years ago
OK. We currently have javascript.options.gczeal, which sets the number passed to JS_SetGCZeal, which is documented here.
  https://developer.mozilla.org/en/JS_SetGCZeal
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:
  javascript.options.gc.mark_stack_size.objects
  javascript.options.gc.mark_stack_size.ropes
  javascript.options.gc.mark_stack_size.xml
  javascript.options.gc.mark_stack_size.large_objects
These would all be integers. They would be used in place of constants, like 
OBJECT_MARK_STACK_SIZE, that are defined in jsgc.h.
(Assignee)

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)
(Reporter)

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+
(Assignee)

Comment 5

6 years ago
I don't have checkin powers.

Updated

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!

http://hg.mozilla.org/integration/mozilla-inbound/rev/7a9e1e25fe6a
Assignee: general → kwierso
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/7a9e1e25fe6a
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
(Assignee)

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?
(Reporter)

Updated

6 years ago
Blocks: 673551
(Reporter)

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.