[
https://issues.apache.org/jira/browse/FLINK-2641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14745186#comment-14745186
]
ASF GitHub Bot commented on FLINK-2641:
---------------------------------------
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
> Integrate the off-heap memory configuration with the TaskManager start script
> -----------------------------------------------------------------------------
>
> Key: FLINK-2641
> URL: https://issues.apache.org/jira/browse/FLINK-2641
> Project: Flink
> Issue Type: New Feature
> Components: Start-Stop Scripts
> Affects Versions: 0.10
> Reporter: Stephan Ewen
> Assignee: Maximilian Michels
> Fix For: 0.10
>
>
> The TaskManager start script needs to adjust the {{-Xmx}}, {{-Xms}}, and
> {{-XX:MaxDirectMemorySize}} parameters according to the off-heap memory
> settings.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)