Changes between Version 4 and Version 5 of JSRootingGuide


Ignore:
Timestamp:
Jun 21, 2014, 11:13:57 PM (10 years ago)
Author:
Yves
Comment:

Added information about GC debugging with JS_GC_ZEAL

Legend:

Unmodified
Added
Removed
Modified
  • JSRootingGuide

    v4 v5  
    6868 * This approach should be used for small numbers of objects that don't get rooted and unrooted often.
    6969 
     70
     71== Testing Rooting ==
     72
     73=== JS_GC_ZEAL (increased GC frequency) ===
     74This is a debugging feature to increase the frequency of garbage collections. It should reveal issues that would only show up in rare cases under normal circumstances.
     75If the feature is enabled in the SpiderMonkey build (--enable-gczeal), you can set the environment variable JS_GC_ZEAL to configure debugging.
     76Set it to -1 to print a table of possible settings (or look up that table in jsgc.cpp).
     77
     78The most useful settings probably are:
     79{{{
     802: GC every F allocations (default: 100)"
     817: Collect the nursery every N nursery allocations"
     82}}}
     83
     84You can append a number separated by a comma to specify F or N respectively (like "2,1" to GC after every allocation or "7,10" to do a minor GC every 10 nursery allocations).
     85With some settings the program gets extremely slow which makes it nearly impossible to use this feature to test a whole replay or even a normal game with maximum GC frequency.