use of org.apache.flink.runtime.util.config.memory.taskmanager.TaskExecutorFlinkMemory 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.taskmanager.TaskExecutorFlinkMemory in project flink by apache.
the class BashJavaUtils method logTaskExecutorConfiguration.
private static void logTaskExecutorConfiguration(TaskExecutorProcessSpec spec) {
TaskExecutorFlinkMemory flinkMemory = spec.getFlinkMemory();
MemorySize totalOffHeapMemory = flinkMemory.getManaged().add(flinkMemory.getJvmDirectMemorySize());
LOG.info("Final TaskExecutor Memory configuration:");
LOG.info(" Total Process Memory: {}", spec.getTotalProcessMemorySize().toHumanReadableString());
LOG.info(" Total Flink Memory: {}", flinkMemory.getTotalFlinkMemorySize().toHumanReadableString());
LOG.info(" Total JVM Heap Memory: {}", flinkMemory.getJvmHeapMemorySize().toHumanReadableString());
LOG.info(" Framework: {}", flinkMemory.getFrameworkHeap().toHumanReadableString());
LOG.info(" Task: {}", flinkMemory.getTaskHeap().toHumanReadableString());
LOG.info(" Total Off-heap Memory: {}", totalOffHeapMemory.toHumanReadableString());
LOG.info(" Managed: {}", flinkMemory.getManaged().toHumanReadableString());
LOG.info(" Total JVM Direct Memory: {}", flinkMemory.getJvmDirectMemorySize().toHumanReadableString());
LOG.info(" Framework: {}", flinkMemory.getFrameworkOffHeap().toHumanReadableString());
LOG.info(" Task: {}", flinkMemory.getTaskOffHeap().toHumanReadableString());
LOG.info(" Network: {}", flinkMemory.getNetwork().toHumanReadableString());
LOG.info(" JVM Metaspace: {}", spec.getJvmMetaspaceSize().toHumanReadableString());
LOG.info(" JVM Overhead: {}", spec.getJvmOverheadSize().toHumanReadableString());
}
use of org.apache.flink.runtime.util.config.memory.taskmanager.TaskExecutorFlinkMemory 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