public static TaskExecutorMemoryConfiguration create(Configuration config) {
        return new TaskExecutorMemoryConfiguration(
                getConfigurationValue(config, FRAMEWORK_HEAP_MEMORY),
                getConfigurationValue(config, TASK_HEAP_MEMORY),
                getConfigurationValue(config, FRAMEWORK_OFF_HEAP_MEMORY),
                getConfigurationValue(config, TASK_OFF_HEAP_MEMORY),
                getConfigurationValue(config, NETWORK_MEMORY_MAX),
                getConfigurationValue(config, MANAGED_MEMORY_SIZE),
                getConfigurationValue(config, JVM_METASPACE),
                getConfigurationValue(config, JVM_OVERHEAD_MAX),
                calculateTotalFlinkMemoryFromComponents(config),
                calculateTotalProcessMemoryFromComponents(config));
    }
@Test
    void testInitialization() {
        Configuration config = new Configuration();

        config.set(FRAMEWORK_HEAP_MEMORY, new MemorySize(1));
        config.set(TASK_HEAP_MEMORY, new MemorySize(2));
        config.set(FRAMEWORK_OFF_HEAP_MEMORY, new MemorySize(3));
        config.set(TASK_OFF_HEAP_MEMORY, new MemorySize(4));
        config.set(NETWORK_MEMORY_MIN, new MemorySize(6));
        config.set(NETWORK_MEMORY_MAX, new MemorySize(6));
        config.set(NETWORK_MEMORY_FRACTION, 0.1f);
        config.set(MANAGED_MEMORY_SIZE, new MemorySize(7));
        config.set(MANAGED_MEMORY_FRACTION, 0.2f);
        config.set(JVM_METASPACE, new MemorySize(8));
        config.set(JVM_OVERHEAD_MIN, new MemorySize(10));
        config.set(JVM_OVERHEAD_MAX, new MemorySize(10));
        config.set(JVM_OVERHEAD_FRACTION, 0.3f);

        TaskExecutorMemoryConfiguration actual = TaskExecutorMemoryConfiguration.create(config);
        TaskExecutorMemoryConfiguration expected =
                new TaskExecutorMemoryConfiguration(1L, 2L, 3L, 4L, 6L, 7L, 8L, 10L, 23L, 41L);

        assertThat(actual).isEqualTo(expected);
    }