pub struct Options {Show 23 fields
pub plan: MMTKOption<PlanSelector>,
pub threads: MMTKOption<usize>,
pub use_short_stack_scans: MMTKOption<bool>,
pub use_return_barrier: MMTKOption<bool>,
pub eager_complete_sweep: MMTKOption<bool>,
pub ignore_system_gc: MMTKOption<bool>,
pub nursery: MMTKOption<NurserySize>,
pub full_heap_system_gc: MMTKOption<bool>,
pub no_finalizer: MMTKOption<bool>,
pub no_reference_types: MMTKOption<bool>,
pub nursery_zeroing: MMTKOption<NurseryZeroingOptions>,
pub stress_factor: MMTKOption<usize>,
pub analysis_factor: MMTKOption<usize>,
pub precise_stress: MMTKOption<bool>,
pub vm_space_start: MMTKOption<Address>,
pub vm_space_size: MMTKOption<usize>,
pub work_perf_events: MMTKOption<PerfEventOptions>,
pub phase_perf_events: MMTKOption<PerfEventOptions>,
pub perf_exclude_kernel: MMTKOption<bool>,
pub thread_affinity: MMTKOption<AffinityKind>,
pub gc_trigger: MMTKOption<GCTriggerSelector>,
pub transparent_hugepages: MMTKOption<bool>,
pub count_live_bytes_in_gc: MMTKOption<bool>,
}
Expand description
MMTk command line options.
Fields§
§plan: MMTKOption<PlanSelector>
The GC plan to use.
threads: MMTKOption<usize>
Number of GC worker threads.
use_short_stack_scans: MMTKOption<bool>
Enable an optimization that only scans the part of the stack that has changed since the last GC (not supported)
use_return_barrier: MMTKOption<bool>
Enable a return barrier (not supported)
eager_complete_sweep: MMTKOption<bool>
Should we eagerly finish sweeping at the start of a collection? (not supported)
ignore_system_gc: MMTKOption<bool>
Should we ignore GCs requested by the user (e.g. java.lang.System.gc)?
nursery: MMTKOption<NurserySize>
The nursery size for generational plans. It can be one of Bounded, ProportionalBounded or Fixed. The nursery size can be set like ‘Fixed:8192’, for example, to have a Fixed nursery size of 8192 bytes, or ‘ProportionalBounded:0.2,1.0’ to have a nursery size between 20% and 100% of the heap size. You can omit lower bound and upper bound to use the default value for bounded nursery by using ‘’. For example, ‘ProportionalBounded:0.1,’ sets the min nursery to 10% of the heap size while using the default value for max nursery.
full_heap_system_gc: MMTKOption<bool>
Should a major GC be performed when a system GC is required?
no_finalizer: MMTKOption<bool>
Should finalization be disabled?
no_reference_types: MMTKOption<bool>
Should reference type processing be disabled?
If reference type processing is disabled, no weak reference processing work is scheduled,
and we expect a binding to treat weak references as strong references.
We disable weak reference processing by default, as we are still working on it. This will be changed to false
once weak reference processing is implemented properly.
nursery_zeroing: MMTKOption<NurseryZeroingOptions>
The zeroing approach to use for new object allocations. Affects each plan differently. (not supported)
stress_factor: MMTKOption<usize>
How frequent (every X bytes) should we do a stress GC?
analysis_factor: MMTKOption<usize>
How frequent (every X bytes) should we run analysis (a STW event that collects data)
precise_stress: MMTKOption<bool>
Precise stress test. Trigger stress GCs exactly at X bytes if this is true. This is usually used to test the GC correctness and will significantly slow down the mutator performance. If this is false, stress GCs will only be triggered when an allocation reaches the slow path. This means we may have allocated more than X bytes or fewer than X bytes when we actually trigger a stress GC. But this should have no obvious mutator overhead, and can be used to test GC performance along with a larger stress factor (e.g. tens of metabytes).
vm_space_start: MMTKOption<Address>
The start of vmspace.
vm_space_size: MMTKOption<usize>
The size of vmspace.
work_perf_events: MMTKOption<PerfEventOptions>
Perf events to measure Semicolons are used to separate events Each event is in the format of event_name,pid,cpu (see man perf_event_open for what pid and cpu mean). For example, PERF_COUNT_HW_CPU_CYCLES,0,-1 measures the CPU cycles for the current process on all the CPU cores. Measuring perf events for work packets. NOTE that be VERY CAREFUL when using this option, as this may greatly slowdown GC performance.
phase_perf_events: MMTKOption<PerfEventOptions>
Measuring perf events for GC and mutators
perf_exclude_kernel: MMTKOption<bool>
Should we exclude perf events occurring in kernel space. By default we include the kernel. Only set this option if you know the implications of excluding the kernel!
thread_affinity: MMTKOption<AffinityKind>
Set how to bind affinity to the GC Workers. Default thread affinity delegates to the OS
scheduler. If a list of cores are specified, cores are allocated to threads in a round-robin
fashion. The core ids should match the ones reported by /proc/cpuinfo. Core ids are
separated by commas and may include ranges. There should be no spaces in the core list. For
example: 0,5,8-11 specifies that cores 0,5,8,9,10,11 should be used for pinning threads.
Note that in the case the program has only been allocated a certain number of cores using
taskset
, the core ids in the list should be specified by their perceived index as using
taskset
will essentially re-label the core ids. For example, running the program with
MMTK_THREAD_AFFINITY="0-4" taskset -c 6-12 <program>
means that the cores 6,7,8,9,10 will
be used to pin threads even though we specified the core ids “0,1,2,3,4”.
MMTK_THREAD_AFFINITY="12" taskset -c 6-12 <program>
will not work, on the other hand, as
there is no core with (perceived) id 12.
gc_trigger: MMTKOption<GCTriggerSelector>
Set the GC trigger. This defines the heap size and how MMTk triggers a GC. Default to a fixed heap size of 0.5x physical memory.
transparent_hugepages: MMTKOption<bool>
Enable transparent hugepage support for MMTk spaces via madvise (only Linux is supported) This only affects the memory for MMTk spaces.
count_live_bytes_in_gc: MMTKOption<bool>
Count live bytes for objects in each space during a GC.
Implementations§
source§impl Options
impl Options
sourcepub fn is_stress_test_gc_enabled(&self) -> bool
pub fn is_stress_test_gc_enabled(&self) -> bool
Check if the options are set for stress GC. If either stress_factor or analysis_factor is set, we should do stress GC.
source§impl Options
impl Options
sourcepub fn set_from_env_var(&mut self, s: &str, val: &str) -> bool
pub fn set_from_env_var(&mut self, s: &str, val: &str) -> bool
Set an option from env var
sourcepub fn set_from_command_line(&mut self, s: &str, val: &str) -> bool
pub fn set_from_command_line(&mut self, s: &str, val: &str) -> bool
Set an option from command line
sourcepub fn set_bulk_from_command_line(&mut self, options: &str) -> bool
pub fn set_bulk_from_command_line(&mut self, options: &str) -> bool
Bulk process options. Returns true if all the options are processed successfully. This method returns false if the option string is invalid, or if it includes any invalid option.
Arguments:
options
: a string that is key value pairs separated by white spaces or commas, e.g.threads=1 stress_factor=4096
, orthreads=1,stress_factor=4096
sourcefn set_inner(&mut self, s: &str, val: &str) -> bool
fn set_inner(&mut self, s: &str, val: &str) -> bool
Set an option and run its validator for its value.
sourcepub fn read_env_var_settings(&mut self)
pub fn read_env_var_settings(&mut self)
Read options from environment variables, and apply those settings to self.
If we have environment variables that start with MMTK_
and match any option (such
as MMTK_STRESS_FACTOR
), we set the option to its value (if it is a valid value).
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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