use of org.apache.flink.runtime.util.config.memory.JvmMetaspaceAndOverhead in project flink by apache.
the class TaskExecutorProcessUtils method processSpecFromWorkerResourceSpec.
public static TaskExecutorProcessSpec processSpecFromWorkerResourceSpec(final Configuration config, final WorkerResourceSpec workerResourceSpec) {
final MemorySize frameworkHeapMemorySize = TaskExecutorFlinkMemoryUtils.getFrameworkHeapMemorySize(config);
final MemorySize frameworkOffHeapMemorySize = TaskExecutorFlinkMemoryUtils.getFrameworkOffHeapMemorySize(config);
final TaskExecutorFlinkMemory flinkMemory = new TaskExecutorFlinkMemory(frameworkHeapMemorySize, frameworkOffHeapMemorySize, workerResourceSpec.getTaskHeapSize(), workerResourceSpec.getTaskOffHeapSize(), workerResourceSpec.getNetworkMemSize(), workerResourceSpec.getManagedMemSize());
final JvmMetaspaceAndOverhead jvmMetaspaceAndOverhead = PROCESS_MEMORY_UTILS.deriveJvmMetaspaceAndOverheadFromTotalFlinkMemory(config, flinkMemory.getTotalFlinkMemorySize());
return new TaskExecutorProcessSpec(workerResourceSpec.getCpuCores(), flinkMemory, jvmMetaspaceAndOverhead, workerResourceSpec.getNumSlots(), workerResourceSpec.getExtendedResources().values());
}
use of org.apache.flink.runtime.util.config.memory.JvmMetaspaceAndOverhead in project flink by apache.
the class TaskExecutorProcessUtils method createMemoryProcessSpec.
private static TaskExecutorProcessSpec createMemoryProcessSpec(final Configuration config, final CommonProcessMemorySpec<TaskExecutorFlinkMemory> processMemory) {
TaskExecutorFlinkMemory flinkMemory = processMemory.getFlinkMemory();
JvmMetaspaceAndOverhead jvmMetaspaceAndOverhead = processMemory.getJvmMetaspaceAndOverhead();
return new TaskExecutorProcessSpec(getCpuCores(config), flinkMemory, jvmMetaspaceAndOverhead, getNumSlots(config), ExternalResourceUtils.getExternalResourcesCollection(config));
}
Aggregations