Enum mozjs_sys::jsapi::JSGCParamKey

source ·
#[repr(u32)]
pub enum JSGCParamKey {
Show 47 variants JSGC_MAX_BYTES = 0, JSGC_MAX_NURSERY_BYTES = 2, JSGC_BYTES = 3, JSGC_NUMBER = 4, JSGC_INCREMENTAL_GC_ENABLED = 5, JSGC_PER_ZONE_GC_ENABLED = 6, JSGC_UNUSED_CHUNKS = 7, JSGC_TOTAL_CHUNKS = 8, JSGC_SLICE_TIME_BUDGET_MS = 9, JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11, JSGC_SMALL_HEAP_SIZE_MAX = 12, JSGC_LARGE_HEAP_SIZE_MIN = 13, JSGC_HIGH_FREQUENCY_SMALL_HEAP_GROWTH = 14, JSGC_HIGH_FREQUENCY_LARGE_HEAP_GROWTH = 15, JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16, JSGC_BALANCED_HEAP_LIMITS_ENABLED = 17, JSGC_HEAP_GROWTH_FACTOR = 18, JSGC_ALLOCATION_THRESHOLD = 19, JSGC_MIN_EMPTY_CHUNK_COUNT = 21, JSGC_MAX_EMPTY_CHUNK_COUNT = 22, JSGC_COMPACTING_ENABLED = 23, JSGC_PARALLEL_MARKING_ENABLED = 24, JSGC_SMALL_HEAP_INCREMENTAL_LIMIT = 25, JSGC_LARGE_HEAP_INCREMENTAL_LIMIT = 26, JSGC_NURSERY_EAGER_COLLECTION_THRESHOLD_KB = 27, JSGC_NURSERY_EAGER_COLLECTION_THRESHOLD_PERCENT = 30, JSGC_MIN_NURSERY_BYTES = 31, JSGC_MIN_LAST_DITCH_GC_PERIOD = 32, JSGC_ZONE_ALLOC_DELAY_KB = 33, JSGC_NURSERY_BYTES = 34, JSGC_MALLOC_THRESHOLD_BASE = 35, JSGC_INCREMENTAL_WEAKMAP_ENABLED = 37, JSGC_CHUNK_BYTES = 38, JSGC_HELPER_THREAD_RATIO = 39, JSGC_MAX_HELPER_THREADS = 40, JSGC_HELPER_THREAD_COUNT = 41, JSGC_MAJOR_GC_NUMBER = 44, JSGC_MINOR_GC_NUMBER = 45, JSGC_NURSERY_EAGER_COLLECTION_TIMEOUT_MS = 46, JSGC_SYSTEM_PAGE_SIZE_KB = 47, JSGC_URGENT_THRESHOLD_MB = 48, JSGC_MARKING_THREAD_COUNT = 49, JSGC_PARALLEL_MARKING_THRESHOLD_MB = 50, JSGC_SEMISPACE_NURSERY_ENABLED = 51, JSGC_MAX_MARKING_THREADS = 52, JSGC_GENERATE_MISSING_ALLOC_SITES = 53, JSGC_SLICE_NUMBER = 54,
}

Variants§

§

JSGC_MAX_BYTES = 0

Maximum nominal heap before last ditch GC.

Soft limit on the number of bytes we are allowed to allocate in the GC heap. Attempts to allocate gcthings over this limit will return null and subsequently invoke the standard OOM machinery, independent of available physical memory.

Pref: javascript.options.mem.max Default: 0xffffffff

§

JSGC_MAX_NURSERY_BYTES = 2

Maximum size of the generational GC nurseries.

This will be rounded to the nearest gc::ChunkSize.

Pref: javascript.options.mem.nursery.max_kb Default: JS::DefaultNurseryMaxBytes

§

JSGC_BYTES = 3

Amount of bytes allocated by the GC.

§

JSGC_NUMBER = 4

Number of times GC has been invoked. Includes both major and minor GC.

§

JSGC_INCREMENTAL_GC_ENABLED = 5

Whether incremental GC is enabled. If not, GC will always run to completion.

prefs: javascript.options.mem.gc_incremental. Default: false

§

JSGC_PER_ZONE_GC_ENABLED = 6

Whether per-zone GC is enabled. If not, all zones are collected every time.

prefs: javascript.options.mem.gc_per_zone Default: false

§

JSGC_UNUSED_CHUNKS = 7

Number of cached empty GC chunks.

§

JSGC_TOTAL_CHUNKS = 8

Total number of allocated GC chunks.

§

JSGC_SLICE_TIME_BUDGET_MS = 9

Max milliseconds to spend in an incremental GC slice.

A value of zero means there is no maximum.

Pref: javascript.options.mem.gc_incremental_slice_ms Default: DefaultTimeBudgetMS.

§

JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11

GCs less than this far apart in milliseconds will be considered ‘high-frequency GCs’.

Pref: javascript.options.mem.gc_high_frequency_time_limit_ms Default: HighFrequencyThreshold

§

JSGC_SMALL_HEAP_SIZE_MAX = 12

Upper limit for classifying a heap as small (MB).

Dynamic heap growth thresholds are based on whether the heap is small, medium or large. Heaps smaller than this size are classified as small; larger heaps are classified as medium or large.

Pref: javascript.options.mem.gc_small_heap_size_max_mb Default: SmallHeapSizeMaxBytes

§

JSGC_LARGE_HEAP_SIZE_MIN = 13

Lower limit for classifying a heap as large (MB).

Dynamic heap growth thresholds are based on whether the heap is small, medium or large. Heaps larger than this size are classified as large; smaller heaps are classified as small or medium.

Pref: javascript.options.mem.gc_large_heap_size_min_mb Default: LargeHeapSizeMinBytes

§

JSGC_HIGH_FREQUENCY_SMALL_HEAP_GROWTH = 14

Heap growth factor for small heaps in the high-frequency GC state.

Pref: javascript.options.mem.gc_high_frequency_small_heap_growth Default: HighFrequencySmallHeapGrowth

§

JSGC_HIGH_FREQUENCY_LARGE_HEAP_GROWTH = 15

Heap growth factor for large heaps in the high-frequency GC state.

Pref: javascript.options.mem.gc_high_frequency_large_heap_growth Default: HighFrequencyLargeHeapGrowth

§

JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16

Heap growth factor for low frequency GCs.

This factor is applied regardless of the size of the heap when not in the high-frequency GC state.

Pref: javascript.options.mem.gc_low_frequency_heap_growth Default: LowFrequencyHeapGrowth

§

JSGC_BALANCED_HEAP_LIMITS_ENABLED = 17

Whether balanced heap limits are enabled.

If this is set to true then heap limits are calculated in a way designed to balance memory usage optimally between many heaps.

Otherwise, heap limits are set based on a linear multiple of the retained size after the last collection.

Pref: javascript.options.mem.gc_balanced_heap_limits Default: BalancedHeapLimitsEnabled

§

JSGC_HEAP_GROWTH_FACTOR = 18

Heap growth parameter for balanced heap limit calculation.

This parameter trades off GC time for memory usage. Smaller values result in lower memory use and larger values result in less time spent collecting.

Heap limits are set to the heap’s retained size plus some extra space. The extra space is calculated based on several factors but is scaled proportionally to this parameter.

Pref: javascript.options.mem.gc_heap_growth_factor Default: HeapGrowthFactor

§

JSGC_ALLOCATION_THRESHOLD = 19

Lower limit for collecting a zone (MB).

Zones smaller than this size will not normally be collected.

Pref: javascript.options.mem.gc_allocation_threshold_mb Default GCZoneAllocThresholdBase

§

JSGC_MIN_EMPTY_CHUNK_COUNT = 21

We try to keep at least this many unused chunks in the free chunk pool at all times, even after a shrinking GC.

Pref: javascript.options.mem.gc_min_empty_chunk_count Default: MinEmptyChunkCount

§

JSGC_MAX_EMPTY_CHUNK_COUNT = 22

We never keep more than this many unused chunks in the free chunk pool.

Pref: javascript.options.mem.gc_max_empty_chunk_count Default: MaxEmptyChunkCount

§

JSGC_COMPACTING_ENABLED = 23

Whether compacting GC is enabled.

Pref: javascript.options.mem.gc_compacting Default: CompactingEnabled

§

JSGC_PARALLEL_MARKING_ENABLED = 24

Whether parallel marking is enabled.

Pref: javascript.options.mem.gc_parallel_marking Default: ParallelMarkingEnabled

§

JSGC_SMALL_HEAP_INCREMENTAL_LIMIT = 25

Limit of how far over the incremental trigger threshold we allow the heap to grow before finishing a collection non-incrementally, for small heaps.

We trigger an incremental GC when a trigger threshold is reached but the collection may not be fast enough to keep up with the mutator. At some point we finish the collection non-incrementally.

Default: SmallHeapIncrementalLimit Pref: javascript.options.mem.gc_small_heap_incremental_limit

§

JSGC_LARGE_HEAP_INCREMENTAL_LIMIT = 26

Limit of how far over the incremental trigger threshold we allow the heap to grow before finishing a collection non-incrementally, for large heaps.

Default: LargeHeapIncrementalLimit Pref: javascript.options.mem.gc_large_heap_incremental_limit

§

JSGC_NURSERY_EAGER_COLLECTION_THRESHOLD_KB = 27

Free space bytes threshold for eager nursery collection.

Default: NurseryChunkUsableSize / 4 Pref: javascript.options.mem.nursery_eager_collection_threshold_kb

§

JSGC_NURSERY_EAGER_COLLECTION_THRESHOLD_PERCENT = 30

Free space fraction threshold for eager nursery collection. This is a percentage (from 0 to 99).

Default: 25 Pref: javascript.options.mem.nursery_eager_collection_threshold_percent

§

JSGC_MIN_NURSERY_BYTES = 31

Minimum size of the generational GC nurseries.

This value will be rounded to the nearest Nursery::SubChunkStep if below gc::ChunkSize, otherwise it’ll be rounded to the nearest gc::ChunkSize.

Default: Nursery::SubChunkLimit Pref: javascript.options.mem.nursery.min_kb

§

JSGC_MIN_LAST_DITCH_GC_PERIOD = 32

The minimum time to allow between triggering last ditch GCs in seconds.

Default: 60 seconds Pref: None

§

JSGC_ZONE_ALLOC_DELAY_KB = 33

The delay (in heapsize kilobytes) between slices of an incremental GC.

Default: ZoneAllocDelayBytes

§

JSGC_NURSERY_BYTES = 34

The delay (in heapsize kilobytes) between slices of an incremental GC.

Default: ZoneAllocDelayBytes

§

JSGC_MALLOC_THRESHOLD_BASE = 35

Retained size base value for calculating malloc heap threshold.

Default: MallocThresholdBase

§

JSGC_INCREMENTAL_WEAKMAP_ENABLED = 37

Whether incremental weakmap marking is enabled.

Pref: javascript.options.mem.incremental_weakmap Default: IncrementalWeakMarkEnabled

§

JSGC_CHUNK_BYTES = 38

The chunk size in bytes for this system.

This parameter is read-only.

§

JSGC_HELPER_THREAD_RATIO = 39

The number of background threads to use for parallel GC work for each CPU core, expressed as an integer percentage.

Pref: javascript.options.mem.gc_helper_thread_ratio

§

JSGC_MAX_HELPER_THREADS = 40

The maximum number of background threads to use for parallel GC work.

Pref: javascript.options.mem.gc_max_helper_threads

§

JSGC_HELPER_THREAD_COUNT = 41

The number of background threads to use for parallel GC work.

This parameter is read-only and is set based on the JSGC_HELPER_THREAD_RATIO and JSGC_MAX_HELPER_THREADS parameters.

§

JSGC_MAJOR_GC_NUMBER = 44

A number that is incremented on every major GC slice.

§

JSGC_MINOR_GC_NUMBER = 45

A number that is incremented on every minor GC.

§

JSGC_NURSERY_EAGER_COLLECTION_TIMEOUT_MS = 46

JS::MaybeRunNurseryCollection will collect the nursery if it hasn’t been collected in this many milliseconds.

Default: 5000 Pref: javascript.options.mem.nursery_eager_collection_timeout_ms

§

JSGC_SYSTEM_PAGE_SIZE_KB = 47

The system page size in KB.

This parameter is read-only.

§

JSGC_URGENT_THRESHOLD_MB = 48

In an incremental GC, this determines the point at which to start increasing the slice budget and frequency of allocation triggered slices to try to avoid reaching the incremental limit and finishing the collection synchronously.

The threshold is calculated by subtracting this value from the heap’s incremental limit.

§

JSGC_MARKING_THREAD_COUNT = 49

Get the number of threads used for parallel marking.

Pref: None.

§

JSGC_PARALLEL_MARKING_THRESHOLD_MB = 50

The heap size above which to use parallel marking.

Pref: javascript.options.mem.gc_parallel_marking_threshold_mb Default: ParallelMarkingThresholdMB

§

JSGC_SEMISPACE_NURSERY_ENABLED = 51

Whether the semispace nursery is enabled.

Pref: javascript.options.mem.gc_experimental_semispace_nursery Default: SemispaceNurseryEnabled

§

JSGC_MAX_MARKING_THREADS = 52

Set the maximum number of threads to use for parallel marking, if enabled.

The actual number used is calculated based on the number of available helper threads and can be found by getting the JSGC_MARKING_THREAD_COUNT parameter.

Pref: javascript.options.mem.gc_max_parallel_marking_threads Default: 2.

§

JSGC_GENERATE_MISSING_ALLOC_SITES = 53

Whether to automatically generate missing allocation sites so data about them can be gathered.

Pref: None, this is an internal engine feature. Default: false.

§

JSGC_SLICE_NUMBER = 54

A number that is incremented every GC slice.

Trait Implementations§

source§

impl Clone for JSGCParamKey

source§

fn clone(&self) -> JSGCParamKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for JSGCParamKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for JSGCParamKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for JSGCParamKey

source§

fn eq(&self, other: &JSGCParamKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for JSGCParamKey

source§

impl Eq for JSGCParamKey

source§

impl StructuralPartialEq for JSGCParamKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T