package com.oracle.svm.core.genscavenge;
import org.graalvm.collections.EconomicMap;
import org.graalvm.compiler.options.Option;
import org.graalvm.compiler.options.OptionKey;
import com.oracle.svm.core.option.HostedOptionKey;
import com.oracle.svm.core.option.RuntimeOptionKey;
import com.oracle.svm.core.util.UserError;
public final class HeapPolicyOptions {
@Option(help = "The maximum heap size as percent of physical memory")
public static final RuntimeOptionKey<Integer> MaximumHeapSizePercent = new RuntimeOptionKey<>(80);
@Option(help = "The maximum size of the young generation as a percentage of the maximum heap size")
public static final RuntimeOptionKey<Integer> MaximumYoungGenerationSizePercent = new RuntimeOptionKey<>(10);
@Option(help = "Bytes that can be allocated before (re-)querying the physical memory size")
public static final HostedOptionKey<Long> AllocationBeforePhysicalMemorySize = new HostedOptionKey<>(1L * 1024L * 1024L);
@Option(help = "The size of an aligned chunk.")
public static final HostedOptionKey<Long> AlignedHeapChunkSize = new HostedOptionKey<Long>(1L * 1024L * 1024L) {
@Override
protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Long oldValue, Long newValue) {
int multiple = 4096;
UserError.guarantee(newValue > 0 && newValue % multiple == 0, "%s value must be a multiple of %d.", getName(), multiple);
}
};
@Option(help = "The size at or above which an array will be allocated in its own unaligned chunk. 0 implies (AlignedHeapChunkSize / 8).")
public static final HostedOptionKey<Long> LargeArrayThreshold = new HostedOptionKey<>(HeapPolicy.LARGE_ARRAY_THRESHOLD_SENTINEL_VALUE);
@Option(help = "Fill unused memory chunks with a sentinel value.")
public static final HostedOptionKey<Boolean> ZapChunks = new HostedOptionKey<>(false);
@Option(help = "Before use, fill memory chunks with a sentinel value.")
public static final HostedOptionKey<Boolean> ZapProducedHeapChunks = new HostedOptionKey<>(false);
@Option(help = "After use, Fill memory chunks with a sentinel value.")
public static final HostedOptionKey<Boolean> ZapConsumedHeapChunks = new HostedOptionKey<>(false);
@Option(help = "Trace heap chunks during collections, if +VerboseGC and +PrintHeapShape.")
public static final RuntimeOptionKey<Boolean> TraceHeapChunks = new RuntimeOptionKey<>(false);
@Option(help = "Maximum number of survivor spaces.")
public static final HostedOptionKey<Integer> MaxSurvivorSpaces = new HostedOptionKey<>(0);
@Option(help = "Determines if a full GC collects the young generation separately or together with the old generation.")
public static final RuntimeOptionKey<Boolean> CollectYoungGenerationSeparately = new RuntimeOptionKey<>(false);
private HeapPolicyOptions() {
}
}