public static TaskExecutorProcessSpec processSpecFromConfig(final Configuration config) {
        try {
            return createMemoryProcessSpec(
                    config, PROCESS_MEMORY_UTILS.memoryProcessSpecFromConfig(config));
        } catch (IllegalConfigurationException e) {
            throw new IllegalConfigurationException(
                    "TaskManager memory configuration failed: " + e.getMessage(), e);
        }
    }
@Test
    void testConfigTotalProcessMemoryLegacySize() {
        final MemorySize totalProcessMemorySize = MemorySize.parse("2g");

        @SuppressWarnings("deprecation")
        final ConfigOption<MemorySize> legacyOption = TaskManagerOptions.TOTAL_PROCESS_MEMORY;

        Configuration conf = new Configuration();
        conf.set(legacyOption, totalProcessMemorySize);

        TaskExecutorProcessSpec taskExecutorProcessSpec =
                TaskExecutorProcessUtils.processSpecFromConfig(conf);
        assertThat(taskExecutorProcessSpec.getTotalProcessMemorySize())
                .isEqualTo(totalProcessMemorySize);
    }