FM
- the FLink memory component structurepublic class ProcessMemoryUtils<FM extends FlinkMemory> extends Object
The utility calculates all common process memory components from CommonProcessMemorySpec
.
It is required to configure at least one subset of the following options and recommended to configure only one:
ProcessMemoryOptions.getRequiredFineGrainedOptions()
ProcessMemoryOptions.getTotalFlinkMemoryOption()
ProcessMemoryOptions.getTotalProcessMemoryOption()
The utility derives the Total Process Memory from the Total Flink Memory and JVM components
and back. To perform the calculations, it uses the provided ProcessMemoryOptions
which
are different for different Flink processes: JM/TM.
The utility also calls the provided FlinkMemoryUtils to derive FlinkMemory
components
from ProcessMemoryOptions.getRequiredFineGrainedOptions()
or from the Total Flink memory.
The concrete FlinkMemoryUtils
is implemented for the respective processes: JM/TM,
according to the specific structure of their FlinkMemory
.
Constructor and Description |
---|
ProcessMemoryUtils(ProcessMemoryOptions options,
FlinkMemoryUtils<FM> flinkMemoryUtils) |
Modifier and Type | Method and Description |
---|---|
JvmMetaspaceAndOverhead |
deriveJvmMetaspaceAndOverheadFromTotalFlinkMemory(Configuration config,
MemorySize totalFlinkMemorySize) |
static MemorySize |
deriveWithFraction(String memoryDescription,
MemorySize base,
RangeFraction rangeFraction) |
static MemorySize |
deriveWithInverseFraction(String memoryDescription,
MemorySize base,
RangeFraction rangeFraction) |
static String |
generateJvmParametersStr(ProcessMemorySpec processSpec) |
static String |
generateJvmParametersStr(ProcessMemorySpec processSpec,
boolean enableDirectMemoryLimit) |
static MemorySize |
getMemorySizeFromConfig(Configuration config,
ConfigOption<MemorySize> option) |
static RangeFraction |
getRangeFraction(MemorySize minSize,
MemorySize maxSize,
ConfigOption<Float> fractionOption,
Configuration config) |
CommonProcessMemorySpec<FM> |
memoryProcessSpecFromConfig(Configuration config) |
public ProcessMemoryUtils(ProcessMemoryOptions options, FlinkMemoryUtils<FM> flinkMemoryUtils)
public CommonProcessMemorySpec<FM> memoryProcessSpecFromConfig(Configuration config)
public JvmMetaspaceAndOverhead deriveJvmMetaspaceAndOverheadFromTotalFlinkMemory(Configuration config, MemorySize totalFlinkMemorySize)
public static MemorySize getMemorySizeFromConfig(Configuration config, ConfigOption<MemorySize> option)
public static RangeFraction getRangeFraction(MemorySize minSize, MemorySize maxSize, ConfigOption<Float> fractionOption, Configuration config)
public static MemorySize deriveWithFraction(String memoryDescription, MemorySize base, RangeFraction rangeFraction)
public static MemorySize deriveWithInverseFraction(String memoryDescription, MemorySize base, RangeFraction rangeFraction)
public static String generateJvmParametersStr(ProcessMemorySpec processSpec)
public static String generateJvmParametersStr(ProcessMemorySpec processSpec, boolean enableDirectMemoryLimit)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.