Github user mxm commented on a diff in the pull request: https://github.com/apache/flink/pull/1129#discussion_r39493933 --- Diff: flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala --- @@ -1586,32 +1586,29 @@ object TaskManager { ConfigConstants.TASK_MANAGER_MEMORY_FRACTION_KEY, "MemoryManager fraction of the free memory must be between 0.0 and 1.0") - val relativeMemSize = (EnvironmentInformation.getSizeOfFreeHeapMemoryWithDefrag() * - fraction).toLong + if (memType == MemoryType.HEAP) { - LOG.info(s"Using $fraction of the currently free heap space for Flink managed " + - s" heap memory (${relativeMemSize >> 20} MB).") + val relativeMemSize = (EnvironmentInformation.getSizeOfFreeHeapMemoryWithDefrag() * + fraction).toLong - relativeMemSize - } - else { - val ratio = configuration.getFloat( - ConfigConstants.TASK_MANAGER_MEMORY_OFF_HEAP_RATIO_KEY, - ConfigConstants.DEFAULT_MEMORY_MANAGER_MEMORY_OFF_HEAP_RATIO) - - checkConfigParameter(ratio > 0.0f, - ConfigConstants.TASK_MANAGER_MEMORY_OFF_HEAP_RATIO_KEY, - "MemoryManager ratio (off-heap memory / heap size) must be larger than zero") - - val maxHeapSize = EnvironmentInformation.getMaxJvmHeapMemory() - val relativeMemSize = (maxHeapSize * ratio).toLong + LOG.info(s"Using $fraction of the currently free heap space for Flink managed " + + s" heap memory (${relativeMemSize >> 20} MB).") + + relativeMemSize + } else if (memType == MemoryType.OFF_HEAP) { - LOG.info(s"Using $ratio time the heap size (${maxHeapSize} bytes) for Flink " + - s"managed off-heap memory (${relativeMemSize >> 20} MB).") + // The maximum heap memory has been adjusted according to the fraction + val directMemorySize = (EnvironmentInformation.getMaxJvmHeapMemory() / fraction).toLong - relativeMemSize + LOG.info(s"Using $fraction of the maximum memory size for " + + s"Flink managed off-heap memory (${directMemorySize >> 20} MB).") + + directMemorySize + } else { --- End diff -- Thanks
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---