You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by xt...@apache.org on 2020/06/28 09:55:29 UTC
[flink] branch master updated (a5c2f26 -> 02e5977)
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git.
from a5c2f26 [FLINK-18423][docs] Fix Prefer tag in document "Detecting Patterns" page of "Streaming Concepts"
new 470e0cc [hotfix][doc] Add memory model figure for JM detailed configuration.
new 98668db [hotfix][doc] Remove total process/flink memory from JM detailed memory configuration table.
new ecb73dd [hotfix][doc] Replace 'Master' with 'JobManager' in memory configuration migration guide.
new df4c7d6 [hotfix][doc] Minor clean-ups in memory configuration docs.
new 59d24ac [hotfix][doc-zh] Fix broken links to rocksdb state backend section
new 02e5977 [FLINK-17465][doc-zh] Update translations for memory configurations.
The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docs/ops/memory/mem_migration.md | 21 ++--
docs/ops/memory/mem_migration.zh.md | 185 +++++++++++++++++++++--------
docs/ops/memory/mem_setup.md | 2 +-
docs/ops/memory/mem_setup.zh.md | 169 +++++++++++++-------------
docs/ops/memory/mem_setup_jobmanager.md | 8 +-
docs/ops/memory/mem_setup_jobmanager.zh.md | 108 +++++++++--------
docs/ops/memory/mem_setup_tm.zh.md | 137 +++++++++++++++------
docs/ops/memory/mem_trouble.md | 1 +
docs/ops/memory/mem_trouble.zh.md | 34 ++++--
docs/ops/memory/mem_tuning.zh.md | 38 ++++--
docs/ops/state/state_backends.zh.md | 2 +
11 files changed, 445 insertions(+), 260 deletions(-)
[flink] 06/06: [FLINK-17465][doc-zh] Update translations for memory
configurations.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 02e5977977ed614debd0d22c1373075c1f8d2a08
Author: Xintong Song <to...@gmail.com>
AuthorDate: Wed Jun 24 10:25:57 2020 +0800
[FLINK-17465][doc-zh] Update translations for memory configurations.
This closes #12761.
---
docs/ops/memory/mem_migration.zh.md | 185 +++++++++++++++++++++--------
docs/ops/memory/mem_setup.zh.md | 169 +++++++++++++-------------
docs/ops/memory/mem_setup_jobmanager.zh.md | 101 ++++++++--------
docs/ops/memory/mem_setup_tm.zh.md | 137 +++++++++++++++------
docs/ops/memory/mem_trouble.zh.md | 34 ++++--
docs/ops/memory/mem_tuning.zh.md | 38 ++++--
6 files changed, 419 insertions(+), 245 deletions(-)
diff --git a/docs/ops/memory/mem_migration.zh.md b/docs/ops/memory/mem_migration.zh.md
index 72af546..68d8e63 100644
--- a/docs/ops/memory/mem_migration.zh.md
+++ b/docs/ops/memory/mem_migration.zh.md
@@ -22,9 +22,10 @@ specific language governing permissions and limitations
under the License.
-->
-在 1.10 版本中,Flink 的 [TaskExecutor 内存配置方法](mem_setup.html)发生了较大的变化。
+在 *1.10* 和 *1.11* 版本中,Flink 分别对 [TaskManager](mem_setup_tm.html) 和 [JobManager](mem_setup_jobmanager.html) 的内存配置方法做出了较大的改变。
部分配置参数被移除了,或是语义上发生了变化。
-本篇升级指南将介绍如何将 [*Flink 1.9 及以前版本*](https://ci.apache.org/projects/flink/flink-docs-release-1.9/ops/mem_setup.html)的内存配置升级到 *Flink 1.10 及以后版本*。
+本篇升级指南将介绍如何将 [*Flink 1.9 及以前版本*](https://ci.apache.org/projects/flink/flink-docs-release-1.9/ops/mem_setup.html)的 TaskManager 内存配置升级到 *Flink 1.10 及以后版本*,
+以及如何将 *Flink 1.10 及以前版本*的 JobManager 内存配置升级到 *Flink 1.11 及以后版本*。
* toc
{:toc}
@@ -32,20 +33,32 @@ under the License.
<div class="alert alert-warning">
<strong>注意:</strong> 请仔细阅读本篇升级指南。
使用原本的和新的内存配制方法可能会使内存组成部分具有截然不同的大小。
- 未经调整直接沿用 Flink 1.10 以前版本的配置文件,可能导致应用的行为、性能发生变化,甚至造成应用执行失败。
+ 未经调整直接沿用 Flink 1.10 以前版本的 TaskManager 配置文件或 Flink 1.11 以前版本的 JobManager 配置文件,可能导致应用的行为、性能发生变化,甚至造成应用执行失败。
</div>
-<span class="label label-info">提示</span> 在 *1.10* 版本之前,Flink 不要求用户一定要配置内存相关的参数,因为这些参数都具有默认值。
-[新的内存配置](mem_setup.html#配置总内存)要求用户至少指定下列配置参数(或参数组合)的其中之一,否则 Flink 将无法启动。
-* [`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size)
-* [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size)
-* [`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) 和 [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size)
+<span class="label label-info">提示</span>
+在 *1.10/1.11* 版本之前,Flink 不要求用户一定要配置 TaskManager/JobManager 内存相关的参数,因为这些参数都具有默认值。
+[新的内存配置](mem_setup.html#configure-total-memory)要求用户至少指定下列配置参数(或参数组合)的其中之一,否则 Flink 将无法启动。
-Flink 自带的[默认 flink-conf.yaml](#flink-confyaml-中的默认配置) 文件指定了 [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size),以便与此前的行为保持一致。
+| **TaskManager:** | **JobManager:** |
+| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------- |
+| [`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size) | [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size) |
+| [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) | [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) |
+| [`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) 和 <br/> [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size) | [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) |
+{:.table-bordered}
+<br/>
+
+Flink 自带的[默认 flink-conf.yaml](#default-configuration-in-flink-confyaml) 文件指定了 [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size)(*>= 1.10*)和 [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) (*>= 1.11*),以便与此前的行为保持一致。
可以使用这张[电子表格](https://docs.google.com/spreadsheets/d/1mJaMkMPfDJJ-w6nMXALYmTc4XxiV30P5U7DzgwLkSoE)来估算和比较原本的和新的内存配置下的计算结果。
-## 配置参数变化
+<a name="migrate-task-manager-memory-configuration" />
+
+## 升级 TaskManager 内存配置
+
+<a name="changes-in-configuration-options" />
+
+### 配置参数变化
本节简要列出了 *Flink 1.10* 引入的配置参数变化,并援引其他章节中关于如何升级到新配置参数的相关描述。
@@ -64,16 +77,16 @@ Flink 自带的[默认 flink-conf.yaml](#flink-confyaml-中的默认配置) 文
<td>
请参考新配置参数 <a href="../config.html#taskmanager-memory-managed-fraction">taskmanager.memory.managed.fraction</a> 的相关描述。
新的配置参数与被移除的配置参数在语义上有所差别,因此其配置值通常也需要做出适当调整。
- 请参考<a href="#托管内存">如何升级托管内存</a>。
+ 请参考<a href="#managed-memory">如何升级托管内存</a>。
</td>
</tr>
<tr>
<td><h5>taskmanager.memory.off-heap</h5></td>
- <td>Flink 不再支持堆上的(On-Heap)<i>托管内存</i>。请参考<a href="#托管内存">如何升级托管内存</a>。</td>
+ <td>Flink 不再支持堆上的(On-Heap)<i>托管内存</i>。请参考<a href="#managed-memory">如何升级托管内存</a>。</td>
</tr>
<tr>
<td><h5>taskmanager.memory.preallocate</h5></td>
- <td>Flink 不再支持内存预分配,今后<i>托管内存</i>将都是惰性分配的。请参考<a href="#托管内存">如何升级托管内存</a>。</td>
+ <td>Flink 不再支持内存预分配,今后<i>托管内存</i>将都是惰性分配的。请参考<a href="#managed-memory">如何升级托管内存</a>。</td>
</tr>
</tbody>
</table>
@@ -83,8 +96,8 @@ Flink 自带的[默认 flink-conf.yaml](#flink-confyaml-中的默认配置) 文
<table class="table table-bordered">
<thead>
<tr>
- <th class="text-left">Deprecated option</th>
- <th class="text-left">Interpreted as</th>
+ <th class="text-left">弃用的配置参数</th>
+ <th class="text-left">对应的新配置参数</th>
</tr>
</thead>
<tbody>
@@ -95,12 +108,12 @@ Flink 自带的[默认 flink-conf.yaml](#flink-confyaml-中的默认配置) 文
<li><a href="../deployment/cluster_setup.html">独立部署模式(Standalone Deployment)</a>下:<a href="../config.html#taskmanager-memory-flink-size">taskmanager.memory.flink.size</a></li>
<li>容器化部署模式(Containerized Deployement)下:<a href="../config.html#taskmanager-memory-process-size">taskmanager.memory.process.size</a></li>
</ul>
- 请参考<a href="#总内存原堆内存">如何升级总内存</a>。
+ 请参考<a href="#total-memory-previously-heap-memory">如何升级总内存</a>。
</td>
</tr>
<tr>
<td><h5>taskmanager.memory.size</h5></td>
- <td><a href="../config.html#taskmanager-memory-managed-size">taskmanager.memory.managed.size</a>。请参考<a href="#托管内存">如何升级托管内存</a>。</td>
+ <td><a href="../config.html#taskmanager-memory-managed-size">taskmanager.memory.managed.size</a>。请参考<a href="#managed-memory">如何升级托管内存</a>。</td>
</tr>
<tr>
<td><h5>taskmanager.network.memory.min</h5></td>
@@ -119,11 +132,14 @@ Flink 自带的[默认 flink-conf.yaml](#flink-confyaml-中的默认配置) 文
尽管网络内存的配置参数没有发生太多变化,我们仍建议您检查其配置结果。
网络内存的大小可能会受到其他内存部分大小变化的影响,例如总内存变化时,根据占比计算出的网络内存也可能发生变化。
-请参考[内存模型详解](mem_setup.html)。
+请参考[内存模型详解](mem_setup_tm.html#detailed-memory-model)。
+
+容器切除(Cut-Off)内存相关的配置参数(`containerized.heap-cutoff-ratio` 和 `containerized.heap-cutoff-min`)将不再对 TaskManager 进程生效。
+请参考[如何升级容器切除内存](#container-cut-off-memory)。
-容器切除(Cut-Off)内存相关的配置参数(`containerized.heap-cutoff-ratio` 和 `containerized.heap-cutoff-min`)将不再对进程生效。
+<a name="total-memory-previously-heap-memory" />
-## 总内存(原堆内存)
+### 总内存(原堆内存)
在原本的内存配置方法中,用于指定用于 Flink 的总内存的配置参数是 `taskmanager.heap.size` 或 `taskmanager.heap.mb`。
尽管这两个参数以“堆(Heap)”命名,实际上它们指定的内存既包含了 JVM 堆内存,也包含了其他堆外内存部分。
@@ -137,81 +153,152 @@ Flink 在 Mesos 上还有另一个具有同样语义的配置参数 `mesos.resou
建议您尽早使用新的配置参数取代启用的配置参数,它们在今后的版本中可能会被彻底移除。
-请参考[如何配置总内存](mem_setup.html#配置总内存).
+请参考[如何配置总内存](mem_setup.html#configure-total-memory).
-## JVM 堆内存
+<a name="jvm-heap-memory" />
+
+### JVM 堆内存
此前,JVM 堆空间由托管内存(仅在配置为堆上时)及 Flink 用到的所有其他堆内存组成。
这里的其他堆内存是由总内存减去所有其他非堆内存得到的。
-请参考[如何升级托管内存](#托管内存)。
+请参考[如何升级托管内存](#managed-memory)。
现在,如果仅配置了*Flink总内存*或*进程总内存*,JVM 的堆空间依然是根据总内存减去所有其他非堆内存得到的。
-请参考[如何配置总内存](mem_setup.html#配置总内存)。
+请参考[如何配置总内存](mem_setup.html#configure-total-memory)。
-此外,你现在可以更直接地控制用于任务和算子的 JVM 的堆内存([`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size)),详见[任务堆内存](mem_setup.html#任务算子堆内存)。
+此外,你现在可以更直接地控制用于任务和算子的 JVM 的堆内存([`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size)),详见[任务堆内存](mem_setup_tm.html#task-operator-heap-memory)。
如果流处理作业选择使用 Heap State Backend([MemoryStateBackend](../state/state_backends.html#memorystatebackend)
或 [FsStateBackend](../state/state_backends.html#fsstatebackend)),那么它同样需要使用 JVM 堆内存。
Flink 现在总是会预留一部分 JVM 堆内存供框架使用([`taskmanager.memory.framework.heap.size`](../config.html#taskmanager-memory-framework-heap-size))。
-请参考[框架内存](mem_setup.html#框架内存)。
+请参考[框架内存](mem_setup_tm.html#framework-memory)。
+
+<a name="managed-memory" />
-## 托管内存
+### 托管内存
-请参考[如何配置托管内存](mem_setup.html#托管内存)。
+请参考[如何配置托管内存](mem_setup_tm.html#managed-memory)。
-### 明确的大小
+<a name="explicit-size" />
+
+#### 明确的大小
原本用于指定明确的托管内存大小的配置参数(`taskmanager.memory.size`)已被弃用,与它具有相同语义的新配置参数为 [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size)。
建议使用新的配置参数,原本的配置参数在今后的版本中可能会被彻底移除。
-### 占比
+<a name="fraction" />
+
+#### 占比
此前,如果不指定明确的大小,也可以将托管内存配置为占用总内存减去网络内存和容器切除内存(仅在 [Yarn](../deployment/yarn_setup.html) 和
[Mesos](../deployment/mesos.html) 上)之后剩余部分的固定比例(`taskmanager.memory.fraction`)。
该配置参数已经被彻底移除,配置它不会产生任何效果。
请使用新的配置参数 [`taskmanager.memory.managed.fraction`](../config.html#taskmanager-memory-managed-fraction)。
-在未通过 [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size) 指定明确大小的情况下,新的配置参数将指定[托管内存](mem_setup.html#托管内存)在 [Flink 总内存](mem_setup.html#配置总内存)中的所占比例。
+在未通过 [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size) 指定明确大小的情况下,新的配置参数将指定[托管内存](mem_setup_tm.html#managed-memory)在 [Flink 总内存](mem_setup.html#configure-total-memory)中的所占比例。
-### RocksDB State Backend
+<a name="rocksdb-state" />
-流处理作业如果选择使用 [RocksDBStateBackend](../state/state_backends.html#rocksdbstatebackend),它使用的本地内存现在也被归为[托管内存](mem_setup.html#托管内存)。
-默认情况下,RocksDB 将限制其内存用量不超过[托管内存](mem_setup.html#托管内存)大小,以避免在 [Yarn](../deployment/yarn_setup.html) 或 [Mesos](../deployment/mesos.html) 上容器被杀。你也可以通过设置 [state.backend.rocksdb.memory.managed](../config.html#state-backend-rocksdb-memory-managed) 来关闭 RocksDB 的内存控制。
-请参考[如何升级容器切除内存](#容器切除cut-off内存)。
+#### RocksDB State Backend
-### 其他变化
+流处理作业如果选择使用 [RocksDBStateBackend](../state/state_backends.html#rocksdbstatebackend),它使用的本地内存现在也被归为[托管内存](mem_setup_tm.html#managed-memory)。
+默认情况下,RocksDB 将限制其内存用量不超过[托管内存](mem_setup_tm.html#managed-memory)大小,以避免在 [Yarn](../deployment/yarn_setup.html) 或 [Mesos](../deployment/mesos.html) 上容器被杀。你也可以通过设置 [state.backend.rocksdb.memory.managed](../config.html#state-backend-rocksdb-memory-managed) 来关闭 RocksDB 的内存控制。
+请参考[如何升级容器切除内存](#container-cut-off-memory)。
+
+<a name="other-changes" />
+
+#### 其他变化
此外,Flink 1.10 对托管内存还引入了下列变化:
-* [托管内存](mem_setup.html#托管内存)现在总是在堆外。配置参数 `taskmanager.memory.off-heap` 已被彻底移除,配置它不会产生任何效果。
-* [托管内存](mem_setup.html#托管内存)现在使用本地内存而非直接内存。这意味着托管内存将不在 JVM 直接内存限制的范围内。
-* [托管内存](mem_setup.html#托管内存)现在总是惰性分配的。配置参数 `taskmanager.memory.preallocate` 已被彻底移除,配置它不会产生任何效果。
+* [托管内存](mem_setup_tm.html#managed-memory)现在总是在堆外。配置参数 `taskmanager.memory.off-heap` 已被彻底移除,配置它不会产生任何效果。
+* [托管内存](mem_setup_tm.html#managed-memory)现在使用本地内存而非直接内存。这意味着托管内存将不在 JVM 直接内存限制的范围内。
+* [托管内存](mem_setup_tm.html#managed-memory)现在总是惰性分配的。配置参数 `taskmanager.memory.preallocate` 已被彻底移除,配置它不会产生任何效果。
+
+<a name="migrate-job-manager-memory-configuration" />
+
+## 升级 JobManager 内存配置
+
+在原本的内存配置方法中,用于指定 *JVM 堆内存* 的配置参数是:
+* `jobmanager.heap.size`
+* `jobmanager.heap.mb`
+
+尽管这两个参数以“堆(Heap)”命名,在此之前它们实际上只有在[独立部署模式](../deployment/cluster_setup.html)才完全对应于 *JVM 堆内存*。
+在容器化部署模式下([Kubernetes](../deployment/kubernetes.html) 和 [Yarn](../deployment/yarn_setup.html)),它们指定的内存还包含了其他堆外内存部分。
+*JVM 堆空间*的实际大小,是参数指定的大小减去容器切除(Cut-Off)内存后剩余的部分。
+容器切除内存在 *1.11* 及以上版本中已被彻底移除。
+
+上述两个参数此前对 [Mesos](../deployment/mesos.html) 部署模式并不生效。
+Flink 在 Mesos 上启动 JobManager 进程时并未设置任何 JVM 内存参数。
+从 *1.11* 版本开始,Flink 将采用与[独立部署模式](../deployment/cluster_setup.html)相同的方式设置这些参数。
+
+这两个配置参数目前已被弃用。
+如果配置了上述弃用的参数,同时又没有配置与之对应的新配置参数,那它们将按如下规则对应到新的配置参数。
+* 独立部署模式(Standalone Deployment)、Mesos 部署模式下:JVM 堆内存([`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size))
+* 容器化部署模式(Containerized Deployement)下(Kubernetes、Yarn):进程总内存([`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size))
+
+建议您尽早使用新的配置参数取代启用的配置参数,它们在今后的版本中可能会被彻底移除。
+
+如果仅配置了 *Flink 总内存*或*进程总内存*,那么 [JVM 堆内存](mem_setup_jobmanager.html#configure-jvm-heap)将是总内存减去其他内存部分后剩余的部分。
+请参考[如何配置总内存](mem_setup.html#configure-total-memory)。
+此外,也可以通过配置 [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) 的方式直接指定 [JVM 堆内存](mem_setup_jobmanager.html#configure-jvm-heap)。
+
+<a name="flink-jvm-process-memory-limits" />
+
+## Flink JVM 进程内存限制
+
+从 *1.10* 版本开始,Flink 通过设置相应的 JVM 参数,对 TaskManager 进程使用的 *JVM Metaspace* 和 *JVM 直接内存*进行限制。
+从 *1.11* 版本开始,Flink 同样对 JobManager 进程使用的 *JVM Metaspace* 进行限制。
+此外,还可以通过设置 [`jobmanager.memory.enable-jvm-direct-memory-limit`](../config.html#jobmanager-memory-enable-jvm-direct-memory-limit) 对 JobManager 进程的 *JVM 直接内存*进行限制。
+请参考 [JVM 参数](mem_setup.html#jvm-parameters)。
+
+Flink 通过设置上述 JVM 内存限制降低内存泄漏问题的排查难度,以避免出现[容器内存溢出](mem_trouble.html#container-memory-exceeded)等问题。
+请参考常见问题中关于 [JVM Metaspace](mem_trouble.html#outofmemoryerror-metaspace) 和 [JVM 直接内存](mem_trouble.html#outofmemoryerror-direct-buffer-memory) *OutOfMemoryError* 异常的描述。
+
+<a name="container-cut-off-memory" />
## 容器切除(Cut-Off)内存
在容器化部署模式(Containerized Deployment)下,此前你可以指定切除内存。
这部分内存将预留给所有未被 Flink 计算在内的内存开销。
其主要来源是不受 Flink 直接管理的依赖使用的内存,例如 RocksDB、JVM 内部开销等。
-相应的配置参数(`containerized.heap-cutoff-ratio` 和 `containerized.heap-cutoff-min`)现在不再对 TaskExecutor 生效。
+相应的配置参数(`containerized.heap-cutoff-ratio` 和 `containerized.heap-cutoff-min`)不再生效。
新的内存配置方法引入了新的内存组成部分来具体描述这些内存用量。
-流处理作业如果使用了 [RocksDBStateBackend](../state/state_backends.html#the-rocksdbstatebackend),RocksDB 使用的本地内存现在将被归为[托管内存](mem_setup.html#托管内存)。
-默认情况下,RocksDB 将限制其内存用量不超过[托管内存](mem_setup.html#托管内存)大小。
-请同时参考[如何升级托管内存](#托管内存)以及[如何配置托管内存](mem_setup.html#托管内存)。
+<a name="for-taskmanagers" />
+
+### TaskManager
-其他直接内存或堆外内存开销,现在可以通过下列配置参数进行设置:
+流处理作业如果使用了 [RocksDBStateBackend](../state/state_backends.html#the-rocksdbstatebackend),RocksDB 使用的本地内存现在将被归为[托管内存](mem_setup_tm.html#managed-memory)。
+默认情况下,RocksDB 将限制其内存用量不超过[托管内存](mem_setup_tm.html#managed-memory)大小。
+请同时参考[如何升级托管内存](#managed-memory)以及[如何配置托管内存](mem_setup_tm.html#managed-memory)。
+
+其他堆外(直接或本地)内存开销,现在可以通过下列配置参数进行设置:
* 任务堆外内存([`taskmanager.memory.task.off-heap.size`](../config.html#taskmanager-memory-task-off-heap-size))
* 框架堆外内存([`taskmanager.memory.framework.off-heap.size`](../config.html#taskmanager-memory-framework-off-heap-size))
* JVM Metaspace([`taskmanager.memory.jvm-metaspace.size`](../config.html#taskmanager-memory-jvm-metaspace-size))
-* JVM 开销(请参考[内存模型详解](mem_setup_tm.html#detailed-memory-model))
+* [JVM 开销](mem_setup_tm.html#detailed-memory-model)
+
+<a name="for-jobmanagers" />
-<span class="label label-info">提示</span> JobManager 进程仍保留了容器切除内存,相关配置项和此前一样仍对 JobManager 生效。
+### JobManager
+
+可以通过下列配置参数设置堆外(直接或本地)内存开销:
+* 堆外内存 ([`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size))
+* JVM Metaspace ([`jobmanager.memory.jvm-metaspace.size`](../config.html#jobmanager-memory-jvm-metaspace-size))
+* [JVM 开销](mem_setup_jobmanager.html#detailed-configuration)
+
+<a name="default-configuration-in-flink-confyaml" />
## flink-conf.yaml 中的默认配置
本节描述 Flink 自带的默认 `flink-conf.yaml` 文件中的变化。
-在默认 `flink-conf.yaml` 文件中,原本的总内存(`taskmanager.heap.size`)被新的配置项 [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) 所取代。
-默认值从 1024Mb 增加到了 1568Mb。
-请参考[如何配置总内存](mem_setup.html#配置总内存)。
+原本的 TaskManager 总内存(`taskmanager.heap.size`)被新的配置项 [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) 所取代。
+默认值从 1024Mb 增加到了 1728Mb。
+
+原本的 JobManager 总内存(`jobmanager.heap.size`)被新的配置项 [`jobmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) 所取代。
+默认值从 1024Mb 增加到了 1600Mb。
+
+请参考[如何配置总内存](mem_setup.html#configure-total-memory)。
<div class="alert alert-warning">
<strong>注意:</strong> 使用新的默认 `flink-conf.yaml` 可能会造成各内存部分的大小发生变化,从而产生性能变化。
diff --git a/docs/ops/memory/mem_setup.zh.md b/docs/ops/memory/mem_setup.zh.md
index 33b7c62..958bcf0 100644
--- a/docs/ops/memory/mem_setup.zh.md
+++ b/docs/ops/memory/mem_setup.zh.md
@@ -1,5 +1,5 @@
---
-title: "Set up Flink's Process Memory"
+title: "配置 Flink 进程的内存"
nav-parent_id: ops_mem
nav-pos: 1
---
@@ -22,134 +22,133 @@ specific language governing permissions and limitations
under the License.
-->
-Apache Flink provides efficient workloads on top of the JVM by tightly controlling the memory usage of its various components.
-While the community strives to offer sensible defaults to all configurations, the full breadth of applications
-that users deploy on Flink means this isn't always possible. To provide the most production value to our users,
-Flink allows both high level and fine-grained tuning of memory allocation within clusters.
+Apache Flink 基于 JVM 的高效处理能力,依赖于其对各组件内存用量的细致掌控。
+考虑到用户在 Flink 上运行的应用的多样性,尽管社区已经努力为所有配置项提供合理的默认值,仍无法满足所有情况下的需求。
+为了给用户生产提供最大化的价值, Flink 允许用户在整体上以及细粒度上对集群的内存分配进行调整。
* toc
{:toc}
-The further described memory configuration is applicable starting with the release version *1.10* for TaskManager and
-*1.11* for JobManager processes. If you upgrade Flink from earlier versions, check the [migration guide](mem_migration.html)
-because many changes were introduced with the *1.10* and *1.11* releases.
+本文接下来介绍的内存配置方法适用于 *1.10* 及以上版本的 TaskManager 进程和 *1.11* 及以上版本的 JobManager 进程。
+Flink 在 *1.10* 和 *1.11* 版本中对内存配置部分进行了较大幅度的改动,从早期版本升级的用户请参考[升级指南](mem_migration.html)。
-## Configure Total Memory
+<a name="configure-total-memory" />
-The *total process memory* of Flink JVM processes consists of memory consumed by the Flink application (*total Flink memory*)
-and by the JVM to run the process. The *total Flink memory* consumption includes usage of *JVM Heap* and *Off-heap*
-(*Direct* or *Native*) memory.
+## 配置总内存
+
+Flink JVM 进程的*进程总内存(Total Process Memory)*包含了由 Flink 应用使用的内存(*Flink 总内存*)以及由运行 Flink 的 JVM 使用的内存。
+*Flink 总内存(Total Flink Memory)*包括 *JVM 堆内存(Heap Memory)*和*堆外内存(Off-Heap Memory)*。
+其中堆外内存包括*直接内存(Direct Memory)*和*本地内存(Native Memory)*。
<center>
<img src="{{ site.baseurl }}/fig/process_mem_model.svg" width="300px" alt="Flink's process memory model" usemap="#process-mem-model">
</center>
<br />
-The simplest way to setup memory in Flink is to configure either of the two following options:
+配置 Flink 进程内存最简单的方法是指定以下两个配置项中的任意一个:
-| **Component** | **Option for TaskManager** | **Option for JobManager** |
+| **配置项** | **TaskManager 配置参数** | **JobManager 配置参数** |
| :------------------------------------ | :---------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- |
-| Total Flink memory | [`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size) | [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size) |
-| Total process memory | [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) | [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) |
+| Flink 总内存 | [`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size) | [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size) |
+| 进程总内存 | [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) | [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) |
{:.table-bordered}
<br/>
-<span class="label label-info">Note</span> For local execution, see detailed information for [TaskManager](mem_setup_tm.html#local-execution) and [JobManager]({% link ops/memory/mem_setup_jobmanager.zh.md %}#local-execxution) processes.
+<span class="label label-info">提示</span>
+关于本地执行,请分别参考 [TaskManager](mem_setup_tm.html#local-execution) 和 [JobManager](mem_setup_jobmanager.html#local-execution) 的相关文档。
-The rest of the memory components will be adjusted automatically, based on default values or additionally configured options.
-See also how to set up other components for [TaskManager](mem_setup_tm.html) and [JobManager]({% link ops/memory/mem_setup_jobmanager.zh.md %}) memory.
+Flink 会根据默认值或其他配置参数自动调整剩余内存部分的大小。
+关于各内存部分的更多细节,请分别参考 [TaskManager](mem_setup_tm.html) 和 [JobManager](mem_setup_jobmanager.html) 的相关文档。
-Configuring *total Flink memory* is better suited for [standalone deployments](../deployment/cluster_setup.html)
-where you want to declare how much memory is given to Flink itself. The *total Flink memory* splits up into *JVM Heap*
-and *Off-heap* memory.
-See also [how to configure memory for standalone deployments](mem_tuning.html#configure-memory-for-standalone-deployment).
+对于[独立部署模式(Standalone Deployment)](../deployment/cluster_setup.html),如果你希望指定由 Flink 应用本身使用的内存大小,最好选择配置 *Flink 总内存*。
+*Flink 总内存*会进一步划分为 *JVM 堆内存*和*堆外内存*。
+更多详情请参考[如何为独立部署模式配置内存](mem_tuning.html#configure-memory-for-standalone-deployment)。
-If you configure *total process memory* you declare how much memory in total should be assigned to the Flink *JVM process*.
-For the containerized deployments it corresponds to the size of the requested container, see also
-[how to configure memory for containers](mem_tuning.html#configure-memory-for-containers)
-([Kubernetes](../deployment/kubernetes.html), [Yarn](../deployment/yarn_setup.html) or [Mesos](../deployment/mesos.html)).
+通过配置*进程总内存*可以指定由 Flink *JVM 进程*使用的总内存大小。
+对于容器化部署模式(Containerized Deployment),这相当于申请的容器(Container)大小,详情请参考[如何配置容器内存](mem_tuning.html#configure-memory-for-containers)([Kubernetes](../deployment/kubernetes.html)、[Yarn](../deployment/yarn_setup.html) 或 [Mesos](../deployment/mesos.html))。
-Another way to set up the memory is to configure the required internal components of the *total Flink memory* which are
-specific to the concrete Flink process. Check how to configure them for [TaskManager](mem_setup_tm.html#configure-heap-and-managed-memory)
-and for [JobManager]({% link ops/memory/mem_setup_jobmanager.zh.md %}#configure-jvm-heap).
+此外,还可以通过设置 *Flink 总内存*的特定内部组成部分的方式来进行内存配置。
+不同进程需要设置的内存组成部分是不一样的。
+详情请分别参考 [TaskManager](mem_setup_tm.html#configure-heap-and-managed-memory) 和 [JobManager](mem_setup_jobmanager.html#configure-jvm-heap) 的相关文档。
-<span class="label label-info">Note</span> One of the three mentioned ways has to be used to configure Flink’s memory
-(except for local execution), or the Flink startup will fail. This means that one of the following option subsets,
-which do not have default values, have to be configured explicitly:
+<span class="label label-info">提示</span>
+以上三种方式中,用户需要至少选择其中一种进行配置(本地运行除外),否则 Flink 将无法启动。
+这意味着,用户需要从以下无默认值的配置参数(或参数组合)中选择一个给出明确的配置:
-| **for TaskManager:** | **for JobManager:** |
+| **TaskManager:** | **JobManager:** |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------- |
| [`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size) | [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size) |
| [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) | [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) |
-| [`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) <br/> and [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size) | [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) |
+| [`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) 和 <br/> [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size) | [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) |
{:.table-bordered}
<br/>
-<span class="label label-info">Note</span> Explicitly configuring both *total process memory* and *total Flink memory*
-is not recommended. It may lead to deployment failures due to potential memory configuration conflicts.
-Configuring other memory components also requires caution as it can produce further configuration conflicts.
+<span class="label label-info">提示</span>
+不建议同时设置*进程总内存*和 *Flink 总内存*。
+这可能会造成内存配置冲突,从而导致部署失败。
+额外配置其他内存部分时,同样需要注意可能产生的配置冲突。
+
+<a name="jvm-parameters" />
-## JVM Parameters
+## JVM 参数
-Flink explicitly adds the following memory related JVM arguments while starting its processes, based on the configured
-or derived memory component sizes:
+Flink 进程启动时,会根据配置的和自动推导出的各内存部分大小,显式地设置以下 JVM 参数:
-| **JVM Arguments** | **Value for TaskManager** | **Value for JobManager** |
-| :----------------------------------------------------------------------------------------- | :------------------------------------------------- | :------------------------------------------------ |
-| *-Xmx* and *-Xms* | Framework + Task Heap Memory | JVM Heap Memory |
-| *-XX:MaxDirectMemorySize*<br/>(always added only for TaskManager, see note for JobManager) | Framework + Task Off-heap (\*) + Network Memory | Off-heap Memory (\*),(\*\*) |
-| *-XX:MaxMetaspaceSize* | JVM Metaspace | JVM Metaspace |
+| **JVM 参数** | **TaskManager 取值** | **JobManager 取值** |
+| :---------------------------------------- | :------------------------------------------------- | :------------------------------------------------ |
+| *-Xmx* 和 *-Xms* | 框架堆内存 + 任务堆内存 | JVM 堆内存 |
+| *-XX:MaxDirectMemorySize*<br/>(TaskManager 始终设置,JobManager 见注释) | 框架堆外内存 + 任务堆外内存(\*) + 网络内存 | 堆外内存 (\*) (\*\*) |
+| *-XX:MaxMetaspaceSize* | JVM Metaspace | JVM Metaspace |
{:.table-bordered}
-(\*) Notice, that the native non-direct usage of memory in user code can be also accounted for as a part of the off-heap memory.
+(\*) 请注意,堆外内存也包括了用户代码使用的本地内存(非直接内存)。
<br/>
-(\*\*) The *JVM Direct memory limit* is added for JobManager process only if the corresponding option
-[`jobmanager.memory.enable-jvm-direct-memory-limit`](../config.html#jobmanager-memory-enable-jvm-direct-memory-limit) is set.
+(\*\*) 只有在 [`jobmanager.memory.enable-jvm-direct-memory-limit`](../config.html#jobmanager-memory-enable-jvm-direct-memory-limit) 设置为 `true` 时,JobManager 才会设置 *JVM 直接内存限制*。
<br/><br/>
-Check also the detailed memory model for [TaskManager](mem_setup_tm.html#detailed-memory-model) and
-[JobManager]({% link ops/memory/mem_setup_jobmanager.zh.md %}#detailed-configuration) to understand how to configure the relevant components.
+相关内存部分的配置方法,请同时参考 [TaskManager](mem_setup_tm.html#detailed-memory-model) 和 [JobManager](mem_setup_jobmanager.html#detailed-configuration) 的详细内存模型。
-## Capped Fractionated Components
+<a name="capped-fractionated-components" />
-This section describes the configuration details of options which can be a fraction of some other memory size while being constrained by a min-max range:
+## 受限的等比内存部分
-* *JVM Overhead* can be a fraction of the *total process memory*
-* *Network memory* can be a fraction of the *total Flink memory* (only for TaskManager)
+本节介绍下列内存部分的配置方法,它们都可以通过指定在总内存中所占比例的方式进行配置,同时受限于相应的的最大/最小值范围。
+* *JVM 开销*:可以配置占用*进程总内存*的固定比例
+* *网络内存*:可以配置占用 *Flink 总内存*的固定比例(仅针对 TaskManager)
-Check also the detailed memory model for [TaskManager](mem_setup_tm.html#detailed-memory-model) and
-[JobManager]({% link ops/memory/mem_setup_jobmanager.zh.md %}#detailed-configuration) to understand how to configure the relevant components.
+相关内存部分的配置方法,请同时参考 [TaskManager](mem_setup_tm.html#detailed-memory-model) 和 [JobManager](mem_setup_jobmanager.html#detailed-configuration) 的详细内存模型。
-The size of those components always has to be between its maximum and minimum value, otherwise Flink startup will fail.
-The maximum and minimum values have defaults or can be explicitly set by corresponding configuration options.
-For example, if you only set the following memory options:
-- *total Process memory* = 1000Mb,
-- *JVM Overhead min* = 64Mb,
-- *JVM Overhead max* = 128Mb,
-- *JVM Overhead fraction* = 0.1
+这些内存部分的大小必须在相应的最大值、最小值范围内,否则 Flink 将无法启动。
+最大值、最小值具有默认值,也可以通过相应的配置参数进行设置。
+例如,如果仅配置下列参数:
+- *进程总内存* = 1000Mb
+- *JVM 开销最小值* = 64Mb
+- *JVM 开销最大值* = 128Mb
+- *JVM 开销占比* = 0.1
-then the *JVM Overhead* will be 1000Mb x 0.1 = 100Mb which is within the range 64-128Mb.
+那么 *JVM 开销*的实际大小将会是 1000Mb x 0.1 = 100Mb,在 64-128Mb 的范围内。
-Notice if you configure the same maximum and minimum value it effectively fixes the size to that value.
+如果将最大值、最小值设置成相同大小,那相当于明确指定了该内存部分的大小。
-If you do not explicitly configure the component memory, then Flink will use the fraction to calculate the memory size
-based on the total memory. The calculated value is capped by its corresponding min/max options.
-For example, if only the following memory options are set:
-- *total Process memory* = 1000Mb,
-- *JVM Overhead min* = 128Mb,
-- *JVM Overhead max* = 256Mb,
-- *JVM Overhead fraction* = 0.1
+如果没有明确指定内存部分的大小,Flink 会根据总内存和占比计算出该内存部分的大小。
+计算得到的内存大小将受限于相应的最大值、最小值范围。
+例如,如果仅配置下列参数:
+- *进程总内存* = 1000Mb
+- *JVM 开销最小值* = 128Mb
+- *JVM 开销最大值* = 256Mb
+- *JVM 开销占比* = 0.1
-then the *JVM Overhead* will be 128Mb because the size derived from fraction is 100Mb, and it is less than the minimum.
+那么 *JVM 开销*的实际大小将会是 128Mb,因为根据总内存和占比计算得到的内存大小 100Mb 小于最小值。
-It can also happen that the fraction is ignored if the sizes of the total memory and its other components are defined.
-In this case, the *JVM Overhead* is the rest of the total memory. The derived value still has to be within its min/max
-range otherwise the configuration fails. For example, suppose only the following memory options are set:
-- *total Process memory* = 1000Mb,
-- *task heap* = 100Mb, (similar example can be for *JVM Heap* in the JobManager)
-- *JVM Overhead min* = 64Mb,
-- *JVM Overhead max* = 256Mb,
-- *JVM Overhead fraction* = 0.1
+如果配置了总内存和其他内存部分的大小,那么 Flink 也有可能会忽略给定的占比。
+这种情况下,受限的等比内存部分的实际大小是总内存减去其他所有内存部分后剩余的部分。
+这样推导得出的内存大小必须符合最大值、最小值范围,否则 Flink 将无法启动。
+例如,如果仅配置下列参数:
+- *进程总内存* = 1000Mb
+- *任务堆内存* = 100Mb(或 JobManager 的 *JVM 堆内存*)
+- *JVM 开销最小值* = 64Mb
+- *JVM 开销最大值* = 256Mb
+- *JVM 开销占比* = 0.1
-All other components of the *total Process memory* have default values, including the default *Managed Memory* fraction
-(or *Off-heap* memory in the JobManager). Then the *JVM Overhead* is not the fraction (1000Mb x 0.1 = 100Mb), but the rest
-of the *total Process memory* which will either be within the range 64-256Mb or fail.
+*进程总内存*中所有其他内存部分均有默认大小,包括 TaskManager 的*托管内存*默认占比或 JobManager 的默认*堆外内存*。
+因此,*JVM 开销*的实际大小不是根据占比算出的大小(1000Mb x 0.1 = 100Mb),而是*进程总内存*中剩余的部分。
+这个剩余部分的大小必须在 64-256Mb 的范围内,否则将会启动失败。
\ No newline at end of file
diff --git a/docs/ops/memory/mem_setup_jobmanager.zh.md b/docs/ops/memory/mem_setup_jobmanager.zh.md
index 3a5ce11..455ac23 100644
--- a/docs/ops/memory/mem_setup_jobmanager.zh.md
+++ b/docs/ops/memory/mem_setup_jobmanager.zh.md
@@ -1,5 +1,5 @@
---
-title: "Set up JobManager Memory"
+title: "配置 JobManager 内存"
nav-parent_id: ops_mem
nav-pos: 3
---
@@ -22,80 +22,87 @@ specific language governing permissions and limitations
under the License.
-->
-The JobManager is the controlling element of the Flink Cluster.
-It consists of three distinct components: Resource Manager, Dispatcher and one JobMaster per running Flink Job.
-This guide walks you through high level and fine-grained memory configurations for the JobManager.
+JobManager 是 Flink 集群的控制单元。
+它由三种不同的组件组成:ResourceManager、Dispatcher 和每个正在运行作业的 JobMaster。
+本篇文档将介绍 JobManager 内存在整体上以及细粒度上的配置方法。
* toc
{:toc}
-The further described memory configuration is applicable starting with the release version *1.11*. If you upgrade Flink
-from earlier versions, check the [migration guide](mem_migration.html) because many changes were introduced with the *1.11* release.
+本文接下来介绍的内存配置方法适用于 *1.11* 及以上版本。
+Flink 在 *1.11* 版本中对内存配置部分进行了较大幅度的改动,从早期版本升级的用户请参考[升级指南](mem_migration.html)。
-<span class="label label-info">Note</span> This memory setup guide is relevant <strong>only for the JobManager</strong>!
-The JobManager memory components have a similar but simpler structure compared to the [TaskManagers' memory configuration](mem_setup_tm.html).
+<span class="label label-info">提示</span>
+本篇内存配置文档<strong>仅针对 JobManager</strong>!
+与 [TaskManager](mem_setup_tm.html) 相比,JobManager 具有相似但更加简单的内存模型。
-## Configure Total Memory
+<a name="configure-total-memory" />
-The simplest way to set up the memory configuration is to configure the [total memory](mem_setup.html#configure-total-memory) for the process.
-If you run the JobManager process using local [execution mode](#local-execution) you do not need to configure memory options, they will have no effect.
+## 配置总内存
-## Detailed configuration
+配置 JobManager 内存最简单的方法就是进程的[配置总内存](mem_setup.html#configure-total-memory)。
+[本地执行模式](#local-execution)下不需要为 JobManager 进行内存配置,配置参数将不会生效。
+
+<a name="detailed-configuration" />
+
+## 详细配置
<center>
<img src="{{ site.baseurl }}/fig/process_mem_model.svg" width="300px" alt="Flink's process memory model" usemap="#process-mem-model">
</center>
<br />
-The following table lists all memory components, depicted above, and references Flink configuration options which
-affect the size of the respective components:
+如上图所示,下表中列出了 Flink JobManager 内存模型的所有组成部分,以及影响其大小的相关配置参数。
-| **Component** | **Configuration options** | **Description** [...]
+| **组成部分** | **配置参数** | **描述** [...]
| :------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- [...]
-| [JVM Heap](#configure-jvm-heap) | [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) | *JVM Heap* memory size for job manager. [...]
-| [Off-heap Memory](#configure-off-heap-memory) | [`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size) | *Off-heap* memory size for job manager. This option covers all off-heap memory usage including direct and native memory allocation. [...]
-| [JVM metaspace](mem_setup.html#jvm-parameters) | [`jobmanager.memory.jvm-metaspace.size`](../config.html#jobmanager-memory-jvm-metaspace-size) | Metaspace size of the Flink JVM process [...]
-| JVM Overhead | [`jobmanager.memory.jvm-overhead.min`](../config.html#jobmanager-memory-jvm-overhead-min) <br/> [`jobmanager.memory.jvm-overhead.max`](../config.html#jobmanager-memory-jvm-overhead-max) <br/> [`jobmanager.memory.jvm-overhead.fraction`](../config.html#jobmanager-memory-jvm-overhead-fraction) | Native memory reserved for other JVM overhead: e.g. thread stacks, code cache, garbage collection space etc, it is a [capped fracti [...]
+| [JVM 堆内存](#configure-jvm-heap) | [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) | JobManager 的 *JVM 堆内存*。 [...]
+| [堆外内存](#configure-off-heap-memory) | [`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size) | JobManager 的*堆外内存(直接内存或本地内存)*。 [...]
+| [JVM Metaspace](mem_setup.html#jvm-parameters) | [`jobmanager.memory.jvm-metaspace.size`](../config.html#jobmanager-memory-jvm-metaspace-size) | Flink JVM 进程的 Metaspace。 [...]
+| JVM 开销 | [`jobmanager.memory.jvm-overhead.min`](../config.html#jobmanager-memory-jvm-overhead-min) <br/> [`jobmanager.memory.jvm-overhead.max`](../config.html#jobmanager-memory-jvm-overhead-max) <br/> [`jobmanager.memory.jvm-overhead.fraction`](../config.html#jobmanager-memory-jvm-overhead-fraction) | 用于其他 JVM 开销的本地内存,例如栈空间、垃圾回收空间等。该内存部分为基于[进程总内存](mem_setup.html#configure-total-memory)的[受限的等比内存部分](mem_setup.html#capped-fractionated-comp [...]
{:.table-bordered}
<br/>
-### Configure JVM Heap
+<a name="configure-jvm-heap" />
+
+### 配置 JVM 堆内存
+
+如[配置总内存](mem_setup.html#configure-total-memory)中所述,另一种配置 JobManager 内存的方式是明确指定 *JVM 堆内存*的大小([`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size))。
+通过这种方式,用户可以更好地掌控用于以下用途的 *JVM 堆内存*大小。
+* Flink 框架
+* 在作业提交时(例如一些特殊的批处理 Source)及 Checkpoint 完成的回调函数中执行的用户代码
-As mentioned before in the [total memory description](mem_setup.html#configure-total-memory), another way to set up the memory
-for the JobManager is to specify explicitly the *JVM Heap* size ([`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size)).
-It gives more control over the available *JVM Heap* which is used by:
+Flink 需要多少 *JVM 堆内存*,很大程度上取决于运行的作业数量、作业的结构及上述用户代码的需求。
-* Flink framework
-* User code executed during job submission (e.g. for certain batch sources) or in checkpoint completion callbacks
+<span class="label label-info">提示</span>
+如果已经明确设置了 *JVM 堆内存*,建议不要再设置*进程总内存*或 *Flink 总内存*,否则可能会造成内存配置冲突。
-The required size of *JVM Heap* is mostly driven by the number of running jobs, their structure, and requirements for
-the mentioned user code.
+在启动 JobManager 进程时,Flink 启动脚本及客户端通过设置 JVM 参数 *-Xms* 和 *-Xmx* 来管理 JVM 堆空间的大小。
+请参考 [JVM 参数](mem_setup.html#jvm-parameters)。
-<span class="label label-info">Note</span> If you have configured the *JVM Heap* explicitly, it is recommended to set
-neither *total process memory* nor *total Flink memory*. Otherwise, it may easily lead to memory configuration conflicts.
-The Flink scripts and CLI set the *JVM Heap* size via the JVM parameters *-Xms* and *-Xmx* when they start the JobManager process, see also [JVM parameters](mem_setup.html#jvm-parameters).
+<a name="configure-off-heap-memory" />
-### Configure Off-heap Memory
+### 配置堆外内存
-The *Off-heap* memory component accounts for any type of *JVM direct memory* and *native memory* usage. Therefore,
-you can also enable the *JVM Direct Memory* limit by setting the [`jobmanager.memory.enable-jvm-direct-memory-limit`](../config.html#jobmanager-memory-enable-jvm-direct-memory-limit) option.
-If this option is configured, Flink will set the limit to the *Off-heap* memory size via the corresponding JVM argument: *-XX:MaxDirectMemorySize*.
-See also [JVM parameters](mem_setup.html#jvm-parameters).
+*堆外内存*包括 *JVM 直接内存* 和 *本地内存*。
+可以通过配置参数 [`jobmanager.memory.enable-jvm-direct-memory-limit`](../config.html#jobmanager-memory-enable-jvm-direct-memory-limit) 设置是否启用 *JVM 直接内存限制*。
+如果该配置项设置为 `true`,Flink 会根据配置的*堆外内存*大小设置 JVM 参数 *-XX:MaxDirectMemorySize*。
+请参考 [JVM 参数](mem_setup.html#jvm-parameters)。
-The size of this component can be configured by [`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size)
-option. This option can be tuned e.g. if the JobManager process throws ‘OutOfMemoryError: Direct buffer memory’, see
-[the troubleshooting guide](mem_trouble.html#outofmemoryerror-direct-buffer-memory) for more information.
+可以通过配置参数 [`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size) 设置堆外内存的大小。
+如果遇到 JobManager 进程抛出 “OutOfMemoryError: Direct buffer memory” 的异常,可以尝试调大这项配置。
+请参考[常见问题](mem_trouble.html#outofmemoryerror-direct-buffer-memory)。
-There can be the following possible sources of *Off-heap* memory consumption:
+一下情况可能用到堆外内存:
+* Flink 框架依赖(例如 Akka 的网络通信)
+* 在作业提交时(例如一些特殊的批处理 Source)及 Checkpoint 完成的回调函数中执行的用户代码
-* Flink framework dependencies (e.g. Akka network communication)
-* User code executed during job submission (e.g. for certain batch sources) or in checkpoint completion callbacks
+<span class="label label-info">提示</span>
+如果同时配置了 [Flink 总内存](mem_setup.html#configure-total-memory)和 [JVM 堆内存](#configure-jvm-heap),且没有配置*堆外内存*,那么*堆外内存*的大小将会是 [Flink 总内存](mem_setup.html#configure-total-memory)减去[JVM 堆内存](#configure-jvm-heap)。
+这种情况下,*对外内存*的默认大小将不会生效。
-<span class="label label-info">Note</span> If you have configured the [Total Flink Memory](mem_setup.html#configure-total-memory)
-and the [JVM Heap](#configure-jvm-heap) explicitly but you have not configured the *Off-heap* memory, the size of the *Off-heap* memory
-will be derived as the [Total Flink Memory](mem_setup.html#configure-total-memory) minus the [JVM Heap](#configure-jvm-heap).
-The default value of the *Off-heap* memory option will be ignored.
+<a name="local-execution" />
-## Local Execution
+## 本地执行
-If you run Flink locally (e.g. from your IDE) without creating a cluster, then the JobManager memory configuration options are ignored.
+如果你是在本地运行 Flink(例如在 IDE 中)而非创建一个集群,那么 JobManager 的内存配置将不会生效。
diff --git a/docs/ops/memory/mem_setup_tm.zh.md b/docs/ops/memory/mem_setup_tm.zh.md
index 862a268..a3cafef 100644
--- a/docs/ops/memory/mem_setup_tm.zh.md
+++ b/docs/ops/memory/mem_setup_tm.zh.md
@@ -22,9 +22,8 @@ specific language governing permissions and limitations
under the License.
-->
-Apache Flink 基于 JVM 的高效处理能力,依赖于其对各组件内存用量的细致掌控。
-考虑到用户在 Flink 上运行的应用的多样性,尽管社区已经努力为所有配置项提供合理的默认值,仍无法满足所有情况下的需求。
-为了给用户生产提供最大化的价值, Flink 允许用户在整体上以及细粒度上对集群的内存分配进行调整。
+Flink 的 TaskManager 负责执行用户代码。
+根据实际需求为 TaskManager 配置内存将有助于减少 Flink 的资源占用,增强作业运行的稳定性。
* toc
{:toc}
@@ -32,7 +31,11 @@ Apache Flink 基于 JVM 的高效处理能力,依赖于其对各组件内存
本文接下来介绍的内存配置方法适用于 *1.10* 及以上版本。
Flink 在 1.10 版本中对内存配置部分进行了较大幅度的改动,从早期版本升级的用户请参考[升级指南](mem_migration.html)。
-<span class="label label-info">提示</span> 本篇内存配置文档<strong>仅针对 TaskExecutor</strong>!关于 JobManager 的内存配置请参考 [JobManager 相关配置参数](../config.html#jobmanager-heap-size)。
+<span class="label label-info">提示</span>
+本篇内存配置文档<strong>仅针对 TaskManager</strong>!
+与 [JobManager](mem_setup_jobmanager.html) 相比,TaskManager 具有相似但更加复杂的内存模型。
+
+<a name="configure-total-memory" />
## 配置总内存
@@ -44,47 +47,36 @@ Flink JVM 进程的*进程总内存(Total Process Memory)*包含了由 Flink
</center>
<br />
-如果你是在本地运行 Flink(例如在 IDE 中)而非创建一个集群,那么本文介绍的配置并非所有都是适用的,详情请参考[本地执行](mem_detail.html#本地执行)。
-
-其他情况下,配置 Flink 内存最简单的方法就是配置下列两个参数中的任意一个。
-* Flink 总内存([`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size))
-* 进程总内存([`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size))
-
-Flink 会根据默认值或其他配置参数自动调整剩余内存部分的大小。关于各内存部分的更多细节,请参考[相关文档](mem_detail.html)。
-
-对于独立部署模式(Standalone Deployment),如果你希望指定由 Flink 应用本身使用的内存大小,最好选择配置 *Flink 总内存*。
-*Flink 总内存*会进一步划分为 JVM 堆内存、[托管内存](#托管内存)和*直接内存*。
+如果你是在本地运行 Flink(例如在 IDE 中)而非创建一个集群,那么本文介绍的配置并非所有都是适用的,详情请参考[本地执行](#local-execution)。
-通过配置*进程总内存*可以指定由 Flink *JVM 进程*使用的总内存大小。
-对于容器化部署模式(Containerized Deployment),这相当于申请的容器(Container)大小,详情请参考[如何配置容器内存](mem_tuning.html#容器container的内存配置)([Kubernetes](../deployment/kubernetes.html)、[Yarn](../deployment/yarn_setup.html) 或 [Mesos](../deployment/mesos.html))。
+其他情况下,配置 Flink 内存最简单的方法就是[配置总内存](mem_setup.html#configure-total-memory)。
+此外,Flink 也支持[更细粒度的内存配置方式](#configure-heap-and-managed-memory)。
-此外,还可以通过设置[任务堆内存(Task Heap Memory)](#任务算子堆内存)和[托管内存](#托管内存)的方式进行内存配置([`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) 和 [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size))。
-这是一种更细粒度的配置方式,更多细节请参考[相关文档](#配置堆内存和托管内存)。
+Flink 会根据默认值或其他配置参数自动调整剩余内存部分的大小。
+接下来的章节将介绍关于各内存部分的更多细节。
-<span class="label label-info">提示</span> 以上三种方式中,用户需要至少选择其中一种进行配置(本地运行除外),否则 Flink 将无法启动。
-这意味着,用户需要从以下无默认值的配置参数(或参数组合)中选择一个给出明确的配置:
-* [`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size)
-* [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size)
-* [`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) 和 [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size)
-
-<span class="label label-info">提示</span> 不建议同时设置*进程总内存*和 *Flink 总内存*。
-这可能会造成内存配置冲突,从而导致部署失败。
-额外配置其他内存部分时,同样需要注意可能产生的配置冲突。
+<a name="configure-heap-and-managed-memory" />
## 配置堆内存和托管内存
-如[配置总内存](#配置总内存)中所述,另一种配置 Flink 内存的方式是同时设置[任务堆内存](#任务算子堆内存)和[托管内存](#托管内存)。
-通过这种方式,用户可以更好地掌控用于 Flink 任务的 JVM 堆内存及 Flink 的[托管内存](#托管内存)大小。
+如[配置总内存](#configure-total-memory)中所述,另一种配置 Flink 内存的方式是同时设置[任务堆内存](#task-operator-heap-memory)和[托管内存](#managed-memory)。
+通过这种方式,用户可以更好地掌控用于 Flink 任务的 JVM 堆内存及 Flink 的[托管内存](#managed-memory)大小。
+
+Flink 会根据默认值或其他配置参数自动调整剩余内存部分的大小。
+关于各内存部分的更多细节,请参考[相关文档](#detailed-memory-model)。
-Flink 会根据默认值或其他配置参数自动调整剩余内存部分的大小。关于各内存部分的更多细节,请参考[相关文档](mem_detail.html)。
+<span class="label label-info">提示</span>
+如果已经明确设置了任务堆内存和托管内存,建议不要再设置*进程总内存*或 *Flink 总内存*,否则可能会造成内存配置冲突。
-<span class="label label-info">提示</span> 如果已经明确设置了任务堆内存和托管内存,建议不要再设置*进程总内存*或 *Flink 总内存*,否则可能会造成内存配置冲突。
+<a name="task-operator-heap-memory" />
### 任务(算子)堆内存
如果希望确保指定大小的 JVM 堆内存给用户代码使用,可以明确指定*任务堆内存*([`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size))。
指定的内存将被包含在总的 JVM 堆空间中,专门用于 Flink 算子及用户代码的执行。
+<a name="managed-memory" />
+
### 托管内存
*托管内存*是由 Flink 负责分配和管理的本地(堆外)内存。
@@ -99,21 +91,90 @@ Flink 会根据默认值或其他配置参数自动调整剩余内存部分的
当同时指定二者时,会优先采用指定的大小(Size)。
若二者均未指定,会根据[默认占比](../config.html#taskmanager-memory-managed-fraction)进行计算。
-请同时参考[如何配置 State Backend 内存](mem_tuning.html#state-backend-的内存配置)以及[如何配置批处理作业内存](mem_tuning.html#批处理作业的内存配置)。
+请同时参考[如何配置 State Backend 内存](mem_tuning.html#configure-memory-for-state-backends)以及[如何配置批处理作业内存](mem_tuning.html#configure-memory-for-batch-jobs)。
+
+<a name="configure-off-heap-memory-direct-or-native" />
## 配置堆外内存(直接内存或本地内存)
-用户代码中分配的堆外内存被归为*任务堆外内存(Task Off-heap Memory),可以通过 [`taskmanager.memory.task.off-heap.size`](../config.html#taskmanager-memory-task-off-heap-size) 指定。
+用户代码中分配的堆外内存被归为*任务堆外内存(Task Off-heap Memory)*,可以通过 [`taskmanager.memory.task.off-heap.size`](../config.html#taskmanager-memory-task-off-heap-size) 指定。
-<span class="label label-info">提示</span> 你也可以调整[框架推外内存(Framework Off-heap Memory)](mem_detail.html#框架内存)。
+<span class="label label-info">提示</span>
+你也可以调整[框架堆外内存(Framework Off-heap Memory)](#framework-memory)。
这是一个进阶配置,建议仅在确定 Flink 框架需要更多的内存时调整该配置。
-Flink 将*框架堆外内存*和*任务堆外内存*都计算在 JVM 的*直接内存*限制中,请参考 [JVM 参数](mem_detail.html#jvm-参数)。
+Flink 将*框架堆外内存*和*任务堆外内存*都计算在 JVM 的*直接内存*限制中,请参考 [JVM 参数](mem_setup.html#jvm-parameters)。
-<span class="label label-info">提示</span> 本地内存(非直接内存)也可以被归在*框架堆外内存*或*任务推外内存*中,在这种情况下 JVM 的*直接内存*限制可能会高于实际需求。
+<span class="label label-info">提示</span>
+本地内存(非直接内存)也可以被归在*框架堆外内存*或*任务堆外内存*中,在这种情况下 JVM 的*直接内存*限制可能会高于实际需求。
-<span class="label label-info">提示</span> *网络内存(Network Memory)*同样被计算在 JVM *直接内存*中。
+<span class="label label-info">提示</span>
+*网络内存(Network Memory)*同样被计算在 JVM *直接内存*中。
Flink 会负责管理网络内存,保证其实际用量不会超过配置大小。
因此,调整*网络内存*的大小不会对其他堆外内存有实质上的影响。
-请参考[内存模型详解](mem_detail.html)。
+请参考[内存模型详解](#detailed-memory-model)。
+
+<a name="detailed-memory-model" />
+
+## 内存模型详解
+
+<br />
+<center>
+ <img src="{{ site.baseurl }}/fig/detailed-mem-model.svg" width="300px" alt="Simple memory model" usemap="#simple-mem-model">
+</center>
+<br />
+
+如上图所示,下表中列出了 Flink TaskManager 内存模型的所有组成部分,以及影响其大小的相关配置参数。
+
+| **组成部分** | **配置参数** | **描述** [...]
+| :------------------------------------------------------------------| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ [...]
+| [框架堆内存(Framework Heap Memory)](#framework-memory) | [`taskmanager.memory.framework.heap.size`](../config.html#taskmanager-memory-framework-heap-size) | 用于 Flink 框架的 JVM 堆内存(进阶配置)。 [...]
+| [任务堆内存(Task Heap Memory)](#task-operator-heap-memory) | [`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) | 用于 Flink 应用的算子及用户代码的 JVM 堆内存。 [...]
+| [托管内存(Managed memory)](#managed-memory) | [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size) <br/> [`taskmanager.memory.managed.fraction`](../config.html#taskmanager-memory-managed-fraction) | 由 Flink 管理的用于排序、哈希表、缓存中间结果及 RocksDB State Backend 的本地内存。 [...]
+| [框架堆外内存(Framework Off-heap Memory)](#framework-memory) | [`taskmanager.memory.framework.off-heap.size`](../config.html#taskmanager-memory-framework-off-heap-size) | 用于 Flink 框架的[堆外内存(直接内存或本地内存)](#configure-off-heap-memory-direct-or-native)(进阶配置)。 [...]
+| [任务堆外内存(Task Off-heap Memory)](#configure-off-heap-memory-direct-or-native)| [`taskmanager.memory.task.off-heap.size`](../config.html#taskmanager-memory-task-off-heap-size) | 用于 Flink 应用的算计及用户代码的[堆外内存(直接内存或本地内存)](#configure-off-heap-memory-direct-or-native)。 [...]
+| 网络内存(Network Memory) | [`taskmanager.memory.network.min`](../config.html#taskmanager-memory-network-min) <br/> [`taskmanager.memory.network.max`](../config.html#taskmanager-memory-network-max) <br/> [`taskmanager.memory.network.fraction`](../config.html#taskmanager-memory-network-fraction) | 用于任务之间数据传输的直接内存(例如网络传输缓冲)。该内存部分为基于 [Flink 总内存](mem_setup.html#configure-total-memory)的[受限的等比内存部分](mem_setup.html#ca [...]
+| [JVM Metaspace](mem_setup.html#jvm-parameters) | [`taskmanager.memory.jvm-metaspace.size`](../config.html#taskmanager-memory-jvm-metaspace-size) | Flink JVM 进程的 Metaspace。 [...]
+| JVM 开销 | [`taskmanager.memory.jvm-overhead.min`](../config.html#taskmanager-memory-jvm-overhead-min) <br/> [`taskmanager.memory.jvm-overhead.max`](../config.html#taskmanager-memory-jvm-overhead-max) <br/> [`taskmanager.memory.jvm-overhead.fraction`](../config.html#taskmanager-memory-jvm-overhead-fraction) | 用于其他 JVM 开销的本地内存,例如栈空间、垃圾回收空间等。该内存部分为基于[进程总内存](mem_setup.html#configure-total-memory)的[受限的等比内存部分](mem_setup.html#capped-fractio [...]
+{:.table-bordered}
+<br/>
+
+我们可以看到,有些内存部分的大小可以直接通过一个配置参数进行设置,有些则需要根据多个参数进行调整。
+
+<a name="framework-memory" />
+
+## 框架内存
+
+通常情况下,不建议对*框架堆内存*和*框架堆外内存*进行调整。
+除非你非常肯定 Flink 的内部数据结构及操作需要更多的内存。
+这可能与具体的部署环境及作业结构有关,例如非常高的并发度。
+此外,Flink 的部分依赖(例如 Hadoop)在某些特定的情况下也可能会需要更多的直接内存或本地内存。
+
+<span class="label label-info">提示</span>
+不管是堆内存还是堆外内存,Flink 中的框架内存和任务内存之间目前是没有隔离的。
+对框架和任务内存的区分,主要是为了在后续版本中做进一步优化。
+
+<a name="local-execution" />
+
+## 本地执行
+如果你是将 Flink 作为一个单独的 Java 程序运行在你的电脑本地而非创建一个集群(例如在 IDE 中),那么只有下列配置会生效,其他配置参数则不会起到任何效果:
+
+| **组成部分** | **配置参数** | **本地执行时的默认值** |
+| :------------------------------------------- | :---------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
+| 任务堆内存 | [`taskmanager.memory.task.heap.size`](../config.html#taskmanager-memory-task-heap-size) | 无穷大 |
+| 任务堆外内存 | [`taskmanager.memory.task.off-heap.size`](../config.html#taskmanager-memory-task-off-heap-size) | 无穷大 |
+| 托管内存 | [`taskmanager.memory.managed.size`](../config.html#taskmanager-memory-managed-size) | 128Mb |
+| 网络内存 | [`taskmanager.memory.network.min`](../config.html#taskmanager-memory-network-min) <br /> [`taskmanager.memory.network.max`](../config.html#taskmanager-memory-network-max) | 64Mb |
+{:.table-bordered}
+<br/>
+
+本地执行模式下,上面列出的所有内存部分均可以但不是必须进行配置。
+如果未配置,则会采用默认值。
+其中,[任务堆内存](#task-operator-heap-memory)和*任务堆外内存*的默认值无穷大(*Long.MAX_VALUE* 字节),以及[托管内存](#managed-memory)的默认值 128Mb 均只针对本地执行模式。
+
+<span class="label label-info">提示</span>
+这种情况下,任务堆内存的大小与实际的堆空间大小无关。
+该配置参数可能与后续版本中的进一步优化相关。
+本地执行模式下,JVM 堆空间的实际大小不受 Flink 掌控,而是取决于本地执行进程是如何启动的。
+如果希望控制 JVM 的堆空间大小,可以在启动进程时明确地指定相关的 JVM 参数,即 *-Xmx* 和 *-Xms*。
diff --git a/docs/ops/memory/mem_trouble.zh.md b/docs/ops/memory/mem_trouble.zh.md
index 52e08e8..7daa8de 100644
--- a/docs/ops/memory/mem_trouble.zh.md
+++ b/docs/ops/memory/mem_trouble.zh.md
@@ -27,43 +27,51 @@ under the License.
## IllegalConfigurationException
-如果遇到从 *TaskExecutorProcessUtils* 抛出的 *IllegalConfigurationException* 异常,这通常说明您的配置参数中存在无效值(例如内存大小为负数、占比大于 1 等)或者配置冲突。
-请根据异常信息,确认[内存模型详解](../config.html#memory-configuration)中与出错的内存部分对应章节的内容。
+如果遇到从 *TaskExecutorProcessUtils* 或 *JobManagerProcessUtils* 抛出的 *IllegalConfigurationException* 异常,这通常说明您的配置参数中存在无效值(例如内存大小为负数、占比大于 1 等)或者配置冲突。
+请根据异常信息,确认出错的内存部分的相关文档及[配置信息](../config.html#memory-configuration)。
## OutOfMemoryError: Java heap space
该异常说明 JVM 的堆空间过小。
-可以通过增大[总内存](mem_setup.html#配置总内存)或[任务堆内存](mem_setup.html#任务算子堆内存)的方法来增大 JVM 堆空间。
+可以通过增大[总内存](mem_setup.html#configure-total-memory)、TaskManager 的[任务堆内存](mem_setup_tm.html#task-operator-heap-memory)、JobManager 的 [JVM 堆内存](mem_setup_jobmanager.html#configure-jvm-heap)等方法来增大 JVM 堆空间。
-<span class="label label-info">提示</span> 也可以增大[框架堆内存](mem_setup_tm.html#框架内存)。这是一个进阶配置,只有在确认是 Flink 框架自身需要更多内存时才应该去调整。
+<span class="label label-info">提示</span>
+也可以增大 TaskManager 的[框架堆内存](mem_setup_tm.html#framework-memory)。
+这是一个进阶配置,只有在确认是 Flink 框架自身需要更多内存时才应该去调整。
## OutOfMemoryError: Direct buffer memory
该异常通常说明 JVM 的*直接内存*限制过小,或者存在*直接内存泄漏(Direct Memory Leak)*。
请确认用户代码及外部依赖中是否使用了 JVM *直接内存*,以及如果使用了直接内存,是否配置了足够的内存空间。
-可以通过调整[堆外内存](mem_detail.html)来增大直接内存限制。
-请同时参考[如何配置堆外内存](mem_setup.html#配置堆外内存直接内存或本地内存))以及 Flink 设置的 [JVM 参数](mem_detail.html#jvm-参数)。
+可以通过调整堆外内存来增大直接内存限制。
+有关堆外内存的配置方法,请参考 [TaskManager](mem_setup_tm.html#configure-off-heap-memory-direct-or-native)、[JobManager](mem_setup_jobmanager.html#configure-off-heap-memory) 以及 [JVM 参数](mem_setup.html#jvm-parameters)的相关文档。
## OutOfMemoryError: Metaspace
-该异常说明 [JVM Metaspace 限制](mem_detail.html#jvm-参数)过小。
-可以尝试调整 [JVM Metaspace 参数](../config.html#taskmanager-memory-jvm-metaspace-size)。
+该异常说明 [JVM Metaspace 限制](mem_setup.html#jvm-parameters)过小。
+可以尝试调整 [TaskManager](../config.html#taskmanager-memory-jvm-metaspace-size)、[JobManager](../config.html#jobmanager-memory-jvm-metaspace-size) 的 JVM Metaspace。
## IOException: Insufficient number of network buffers
-该异常通常说明[网络内存](mem_detail.html)过小。
+该异常仅与 TaskManager 相关。
+
+该异常通常说明[网络内存](mem_setup_tm.html#detailed-memory-model)过小。
可以通过调整以下配置参数增大*网络内存*:
* [`taskmanager.memory.network.min`](../config.html#taskmanager-memory-network-min)
* [`taskmanager.memory.network.max`](../config.html#taskmanager-memory-network-max)
* [`taskmanager.memory.network.fraction`](../config.html#taskmanager-memory-network-fraction)
+<a name="container-memory-exceeded" />
+
## 容器(Container)内存超用
-如果 TaskExecutor 容器尝试分配超过其申请大小的内存(Yarn、Mesos 或 Kubernetes),这通常说明 Flink 没有预留出足够的本地内存。
+如果 Flink 容器尝试分配超过其申请大小的内存(Yarn、Mesos 或 Kubernetes),这通常说明 Flink 没有预留出足够的本地内存。
可以通过外部监控系统或者容器被部署环境杀掉时的错误信息判断是否存在容器内存超用。
-如果使用了 [RocksDBStateBackend](../state/state_backends.html#rocksdbstatebackend) 且没有开启内存控制,也可以尝试增大[托管内存](mem_setup.html#托管内存)。
+对于 *JobManager* 进程,你还可以尝试启用 *JVM 直接内存限制*([`jobmanager.memory.enable-jvm-direct-memory-limit`](../config.html#jobmanager-memory-enable-jvm-direct-memory-limit)),以排除 *JVM 直接内存泄漏*的可能性。
+
+如果使用了 [RocksDBStateBackend](../state/state_backends.html#rocksdbstatebackend) 且没有开启内存控制,也可以尝试增大 TaskManager 的[托管内存](mem_setup.html#managed-memory)。
-此外,还可以尝试增大 [JVM 开销](mem_detail.html)。
+此外,还可以尝试增大 [JVM 开销](mem_setup.html#capped-fractionated-components)。
-请参考[如何配置容器内存](mem_tuning.html#容器container的内存配置)。
+请参考[如何配置容器内存](mem_tuning.html#configure-memory-for-containers)。
diff --git a/docs/ops/memory/mem_tuning.zh.md b/docs/ops/memory/mem_tuning.zh.md
index eac6331..e4f8c99 100644
--- a/docs/ops/memory/mem_tuning.zh.md
+++ b/docs/ops/memory/mem_tuning.zh.md
@@ -22,54 +22,66 @@ specific language governing permissions and limitations
under the License.
-->
-本文在的基本的[配置指南](mem_setup.html)的基础上,介绍如何根据具体的使用场景调整 TaskExecutor 的内存配置,以及在不同使用场景下分别需要重点关注哪些配置参数。
+本文在的基本的[配置指南](mem_setup.html)的基础上,介绍如何根据具体的使用场景调整内存配置,以及在不同使用场景下分别需要重点关注哪些配置参数。
* toc
{:toc}
+<a name="configure-memory-for-standalone-deployment" />
+
## 独立部署模式(Standalone Deployment)下的内存配置
-[独立部署模式](../deployment/cluster_setup.html),我们通常更关注 Flink 应用本身使用的内存大小。
-建议配置 [Flink 总内存](mem_setup.html#配置总内存)([`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size))或者它的([`jobmanager.memory.flink.size`])(../config.html#jobmanager-memory-flink-size.html)。
+[独立部署模式](../deployment/cluster_setup.html)下,我们通常更关注 Flink 应用本身使用的内存大小。
+建议配置 [Flink 总内存](mem_setup.html#configure-total-memory)([`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size) 或者 [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size.html))或其组成部分。
此外,如果出现 [Metaspace 不足的问题](mem_trouble.html#outofmemoryerror-metaspace),可以调整 *JVM Metaspace* 的大小。
这种情况下通常无需配置*进程总内存*,因为不管是 Flink 还是部署环境都不会对 *JVM 开销* 进行限制,它只与机器的物理资源相关。
+<a name="configure-memory-for-containers" />
+
## 容器(Container)的内存配置
-在容器化部署模式(Containerized Deployment)下([Kubernetes](../deployment/kubernetes.html)、[Yarn](../deployment/yarn_setup.html) 或 [Mesos](../deployment/mesos.html)),建议配置[进程总内存](mem_setup.html#配置总内存)([`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size))。
+在容器化部署模式(Containerized Deployment)下([Kubernetes](../deployment/kubernetes.html)、[Yarn](../deployment/yarn_setup.html) 或 [Mesos](../deployment/mesos.html)),建议配置[进程总内存](mem_setup.html#configure-total-memory)([`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) 或者 [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size))。
该配置参数用于指定分配给 Flink *JVM 进程*的总内存,也就是需要申请的容器大小。
-<span class="label label-info">提示</span> 如果配置了 *Flink 总内存*,Flink 会自动加上 JVM 相关的内存部分,根据推算出的*进程总内存*大小申请容器。
+<span class="label label-info">提示</span>
+如果配置了 *Flink 总内存*,Flink 会自动加上 JVM 相关的内存部分,根据推算出的*进程总内存*大小申请容器。
<div class="alert alert-warning">
<strong>注意:</strong> 如果 Flink 或者用户代码分配超过容器大小的非托管的堆外(本地)内存,部署环境可能会杀掉超用内存的容器,造成作业执行失败。
</div>
-请参考[容器内存超用](mem_trouble.html#容器container内存超用)中的相关描述。
+
+请参考[容器内存超用](mem_trouble.html#container-memory-exceeded)中的相关描述。
+
+<a name="configure-memory-for-state-backends" />
## State Backend 的内存配置
+本章节内容仅与 TaskManager 相关。
+
在部署 Flink 流处理应用时,可以根据 [State Backend](../state/state_backends.html) 的类型对集群的配置进行优化。
### Heap State Backend
执行无状态作业或者使用 Heap State Backend([MemoryStateBackend](../state/state_backends.html#memorystatebackend)
-或 [FsStateBackend](../state/state_backends.html#fsstatebackend))时,建议将[托管内存](mem_setup.html#托管内存)设置为 0。
+或 [FsStateBackend](../state/state_backends.html#fsstatebackend))时,建议将[托管内存](mem_setup_tm.html#managed-memory)设置为 0。
这样能够最大化分配给 JVM 上用户代码的内存。
### RocksDB State Backend
[RocksDBStateBackend](../state/state_backends.html#rocksdbstatebackend) 使用本地内存。
-默认情况下,RocksDB 会限制其内存用量不超过用户配置的[*托管内存*](mem_setup.html#托管内存)。
+默认情况下,RocksDB 会限制其内存用量不超过用户配置的[*托管内存*](mem_setup_tm.html#managed-memory)。
因此,使用这种方式存储状态时,配置足够多的*托管内存*是十分重要的。
-如果你关闭了 RocksDB 的内存控制,那么在容器化部署模式下如果 RocksDB 分配的内存超出了申请容器的大小([进程总内存](mem_setup.html#配置总内存)),可能会造成 TaskExecutor 被部署环境杀掉。
+如果你关闭了 RocksDB 的内存控制,那么在容器化部署模式下如果 RocksDB 分配的内存超出了申请容器的大小([进程总内存](mem_setup.html#configure-total-memory)),可能会造成 TaskExecutor 被部署环境杀掉。
请同时参考[如何调整 RocksDB 内存](../state/large_state_tuning.html#tuning-rocksdb-memory)以及 [state.backend.rocksdb.memory.managed](../config.html#state-backend-rocksdb-memory-managed)。
+<a name="configure-memory-for-batch-jobs" />
+
## 批处理作业的内存配置
-Flink 批处理算子使用[托管内存](../memory/mem_setup.html#托管内存)来提高处理效率。
+Flink 批处理算子使用[托管内存](../memory/mem_setup_tm.html#managed-memory)来提高处理效率。
算子运行时,部分操作可以直接在原始数据上进行,而无需将数据反序列化成 Java 对象。
-这意味着[托管内存](../memory/mem_setup.html#托管内存)对应用的性能具有实质上的影响。
-因此 Flink 会在不超过其配置限额的前提下,尽可能分配更多的[托管内存](../memory/mem_setup.html#托管内存)。
+这意味着[托管内存](../memory/mem_setup_tm.html#managed-memory)对应用的性能具有实质上的影响。
+因此 Flink 会在不超过其配置限额的前提下,尽可能分配更多的[托管内存](../memory/mem_setup_tm.html#managed-memory)。
Flink 明确知道可以使用的内存大小,因此可以有效避免 `OutOfMemoryError` 的发生。
-当[托管内存](../memory/mem_setup.html#托管内存)不足时,Flink 会优雅的将数据落盘。
+当[托管内存](../memory/mem_setup_tm.html#managed-memory)不足时,Flink 会优雅地将数据落盘。
[flink] 04/06: [hotfix][doc] Minor clean-ups in memory
configuration docs.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit df4c7d6b9d5718c8a755bbba36ac58ae5f689b40
Author: Xintong Song <to...@gmail.com>
AuthorDate: Wed Jun 24 13:01:18 2020 +0800
[hotfix][doc] Minor clean-ups in memory configuration docs.
---
docs/ops/memory/mem_migration.md | 7 ++++---
docs/ops/memory/mem_setup.md | 2 +-
docs/ops/memory/mem_setup_jobmanager.md | 1 +
docs/ops/memory/mem_trouble.md | 1 +
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/docs/ops/memory/mem_migration.md b/docs/ops/memory/mem_migration.md
index 28dff3c..94c04fe 100644
--- a/docs/ops/memory/mem_migration.md
+++ b/docs/ops/memory/mem_migration.md
@@ -59,7 +59,7 @@ to make the default memory configuration consistent.
This [spreadsheet](https://docs.google.com/spreadsheets/d/1mJaMkMPfDJJ-w6nMXALYmTc4XxiV30P5U7DzgwLkSoE) can also help
to evaluate and compare the results of the legacy and new memory computations.
-## Migrate Task Executor Memory Configuration
+## Migrate Task Manager Memory Configuration
### Changes in Configuration Options
@@ -79,7 +79,7 @@ The following options are completely removed. If they are still used, they will
<tr>
<td><h5>taskmanager.memory.fraction</h5></td>
<td>
- Check the description of the new option <a href="../config.html#taskmanager-memory-managed-fraction)">taskmanager.memory.managed.fraction</a>.
+ Check the description of the new option <a href="../config.html#taskmanager-memory-managed-fraction">taskmanager.memory.managed.fraction</a>.
The new option has different semantics and the value of the deprecated option usually has to be adjusted.
See also <a href="#managed-memory">how to migrate managed memory</a>.
</td>
@@ -139,7 +139,7 @@ It can change if other memory components have new sizes, e.g. the total memory w
See also [new detailed memory model](mem_setup_tm.html#detailed-memory-model).
The container cut-off configuration options, `containerized.heap-cutoff-ratio` and `containerized.heap-cutoff-min`,
-have no effect anymore. See also [how to migrate container cut-off](#container-cut-off-memory).
+have no effect anymore for TaskManagers. See also [how to migrate container cut-off](#container-cut-off-memory).
### Total Memory (Previously Heap Memory)
@@ -231,6 +231,7 @@ The mentioned legacy options have been deprecated. If they are used without spec
they will be directly translated into the following new options:
* JVM Heap ([`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size)) for [standalone](../deployment/cluster_setup.html) and [Mesos](../deployment/mesos.html) deployments
* Total process memory ([`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size)) for containerized deployments ([Kubernetes](../deployment/kubernetes.html) and [Yarn](../deployment/yarn_setup.html))
+
It is also recommended using these new options instead of the legacy ones as they might be completely removed in the following releases.
Now, if only the *total Flink memory* or *total process memory* is configured, then the [JVM Heap]({% link ops/memory/mem_setup_jobmanager.md %}#configure-jvm-heap)
diff --git a/docs/ops/memory/mem_setup.md b/docs/ops/memory/mem_setup.md
index b39cdab..98ca61d 100644
--- a/docs/ops/memory/mem_setup.md
+++ b/docs/ops/memory/mem_setup.md
@@ -54,7 +54,7 @@ The simplest way to setup memory in Flink is to configure either of the two foll
{:.table-bordered}
<br/>
-<span class="label label-info">Note</span> For local execution, see detailed information for [TaskManager](mem_setup_tm.html#local-execution) and [JobManager]({% link ops/memory/mem_setup_jobmanager.md %}#local-execxution) processes.
+<span class="label label-info">Note</span> For local execution, see detailed information for [TaskManager](mem_setup_tm.html#local-execution) and [JobManager]({% link ops/memory/mem_setup_jobmanager.md %}#local-execution) processes.
The rest of the memory components will be adjusted automatically, based on default values or additionally configured options.
See also how to set up other components for [TaskManager](mem_setup_tm.html) and [JobManager]({% link ops/memory/mem_setup_jobmanager.md %}) memory.
diff --git a/docs/ops/memory/mem_setup_jobmanager.md b/docs/ops/memory/mem_setup_jobmanager.md
index 3a5ce11..379e2f7 100644
--- a/docs/ops/memory/mem_setup_jobmanager.md
+++ b/docs/ops/memory/mem_setup_jobmanager.md
@@ -73,6 +73,7 @@ the mentioned user code.
<span class="label label-info">Note</span> If you have configured the *JVM Heap* explicitly, it is recommended to set
neither *total process memory* nor *total Flink memory*. Otherwise, it may easily lead to memory configuration conflicts.
+
The Flink scripts and CLI set the *JVM Heap* size via the JVM parameters *-Xms* and *-Xmx* when they start the JobManager process, see also [JVM parameters](mem_setup.html#jvm-parameters).
### Configure Off-heap Memory
diff --git a/docs/ops/memory/mem_trouble.md b/docs/ops/memory/mem_trouble.md
index 64c479b..1f68ccb 100644
--- a/docs/ops/memory/mem_trouble.md
+++ b/docs/ops/memory/mem_trouble.md
@@ -80,4 +80,5 @@ If [RocksDBStateBackend](../state/state_backends.html#the-rocksdbstatebackend) i
you can try to increase the TaskManager's [managed memory](mem_setup.html#managed-memory).
Alternatively, you can increase the [JVM Overhead](mem_setup.html#capped-fractionated-components).
+
See also [how to configure memory for containers](mem_tuning.html#configure-memory-for-containers).
[flink] 03/06: [hotfix][doc] Replace 'Master' with 'JobManager' in
memory configuration migration guide.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit ecb73ddcfba2e17f1387e6c0c5f12652bfd8c348
Author: Xintong Song <to...@gmail.com>
AuthorDate: Wed Jun 24 13:45:25 2020 +0800
[hotfix][doc] Replace 'Master' with 'JobManager' in memory configuration migration guide.
---
docs/ops/memory/mem_migration.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/ops/memory/mem_migration.md b/docs/ops/memory/mem_migration.md
index 0282579..28dff3c 100644
--- a/docs/ops/memory/mem_migration.md
+++ b/docs/ops/memory/mem_migration.md
@@ -26,7 +26,7 @@ The memory setup has changed a lot with the *1.10* release for [TaskManagers](me
release for [JobManagers]({% link ops/memory/mem_setup_jobmanager.md %}). Many configuration options were removed or their semantics changed.
This guide will help you to migrate the TaskManager memory configuration from Flink
[<= *1.9*](https://ci.apache.org/projects/flink/flink-docs-release-1.9/ops/mem_setup.html) to >= *1.10* and
-the Master memory configuration from Flink <= *1.10* to >= *1.11*.
+the JobManager memory configuration from Flink <= *1.10* to >= *1.11*.
* toc
{:toc}
@@ -34,16 +34,16 @@ the Master memory configuration from Flink <= *1.10* to >= *1.11*.
<div class="alert alert-warning">
<strong>Warning:</strong> It is important to review this guide because the legacy and new memory configuration can
result in different sizes of memory components. If you try to reuse your Flink configuration from older versions
- before 1.10 for TaskManagers or before 1.11 for Masters, it can result in changes to the behavior,
+ before 1.10 for TaskManagers or before 1.11 for JobManagers, it can result in changes to the behavior,
performance or even configuration failures of your application.
</div>
-<span class="label label-info">Note</span> Before version *1.10* for TaskManagers and before *1.11* for Masters,
+<span class="label label-info">Note</span> Before version *1.10* for TaskManagers and before *1.11* for JobManagers,
Flink did not require that memory related options are set at all as they all had default values.
The [new memory configuration](mem_setup.html#configure-total-memory) requires that at least one subset of
the following options is configured explicitly, otherwise the configuration will fail:
-| **for TaskManager:** | **for Master:** |
+| **for TaskManager:** | **for JobManager:** |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------- |
| [`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size) | [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size) |
| [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size) | [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) |
@@ -224,7 +224,7 @@ they also included other off-heap memory consumption. The size of *JVM Heap* was
cut-off which has been completely removed after *1.11*.
The [Mesos](../deployment/mesos.html) integration did not take into account the mentioned legacy memory options.
-The scripts provided in Flink to start the Mesos Master process did not set any memory JVM arguments. After the *1.11* release,
+The scripts provided in Flink to start the Mesos JobManager process did not set any memory JVM arguments. After the *1.11* release,
they are set the same way as it is done by the [standalone deployment](../deployment/cluster_setup.html) scripts.
The mentioned legacy options have been deprecated. If they are used without specifying the corresponding new options,
@@ -272,7 +272,7 @@ The other direct or native off-heap memory consumers can now be addressed by the
* JVM metaspace ([`taskmanager.memory.jvm-metaspace.size`](../config.html#taskmanager-memory-jvm-metaspace-size))
* [JVM overhead](mem_setup_tm.html#detailed-memory-model)
-### for Masters
+### for JobManagers
The direct or native off-heap memory consumers can now be addressed by the following new configuration options:
* Off-heap memory ([`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size))
@@ -286,7 +286,7 @@ This section describes the changes of the default `flink-conf.yaml` shipped with
The total memory for TaskManagers (`taskmanager.heap.size`) is replaced by [`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size)
in the default `flink-conf.yaml`. The value increased from 1024Mb to 1728Mb.
-The total memory for Masters (`jobmanager.heap.size`) is replaced by [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size)
+The total memory for JobManagers (`jobmanager.heap.size`) is replaced by [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size)
in the default `flink-conf.yaml`. The value increased from 1024Mb to 1600Mb.
See also [how to configure total memory now](mem_setup.html#configure-total-memory).
[flink] 02/06: [hotfix][doc] Remove total process/flink memory from
JM detailed memory configuration table.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 98668db6d0731e6927b761ef2c1723867b37444e
Author: Xintong Song <to...@gmail.com>
AuthorDate: Wed Jun 24 12:49:12 2020 +0800
[hotfix][doc] Remove total process/flink memory from JM detailed memory configuration table.
---
docs/ops/memory/mem_setup_jobmanager.md | 2 --
docs/ops/memory/mem_setup_jobmanager.zh.md | 2 --
2 files changed, 4 deletions(-)
diff --git a/docs/ops/memory/mem_setup_jobmanager.md b/docs/ops/memory/mem_setup_jobmanager.md
index fab21a6..3a5ce11 100644
--- a/docs/ops/memory/mem_setup_jobmanager.md
+++ b/docs/ops/memory/mem_setup_jobmanager.md
@@ -52,8 +52,6 @@ affect the size of the respective components:
| **Component** | **Configuration options** | **Description** [...]
| :------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- [...]
-| [Total Process Memory](mem_setup.html#configure-total-memory) | [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) | The *total process memory* size for the job manager. This includes all the memory that a job manager JVM process consumes, consisti [...]
-| [Total Flink Memory](mem_setup.html#configure-total-memory) | [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size) | The *total Flink memory* size for the job manager. This includes all the memory that a job manager consumes, except for *JVM metasp [...]
| [JVM Heap](#configure-jvm-heap) | [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) | *JVM Heap* memory size for job manager. [...]
| [Off-heap Memory](#configure-off-heap-memory) | [`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size) | *Off-heap* memory size for job manager. This option covers all off-heap memory usage including direct and native memory allocation. [...]
| [JVM metaspace](mem_setup.html#jvm-parameters) | [`jobmanager.memory.jvm-metaspace.size`](../config.html#jobmanager-memory-jvm-metaspace-size) | Metaspace size of the Flink JVM process [...]
diff --git a/docs/ops/memory/mem_setup_jobmanager.zh.md b/docs/ops/memory/mem_setup_jobmanager.zh.md
index fab21a6..3a5ce11 100644
--- a/docs/ops/memory/mem_setup_jobmanager.zh.md
+++ b/docs/ops/memory/mem_setup_jobmanager.zh.md
@@ -52,8 +52,6 @@ affect the size of the respective components:
| **Component** | **Configuration options** | **Description** [...]
| :------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- [...]
-| [Total Process Memory](mem_setup.html#configure-total-memory) | [`jobmanager.memory.process.size`](../config.html#jobmanager-memory-process-size) | The *total process memory* size for the job manager. This includes all the memory that a job manager JVM process consumes, consisti [...]
-| [Total Flink Memory](mem_setup.html#configure-total-memory) | [`jobmanager.memory.flink.size`](../config.html#jobmanager-memory-flink-size) | The *total Flink memory* size for the job manager. This includes all the memory that a job manager consumes, except for *JVM metasp [...]
| [JVM Heap](#configure-jvm-heap) | [`jobmanager.memory.heap.size`](../config.html#jobmanager-memory-heap-size) | *JVM Heap* memory size for job manager. [...]
| [Off-heap Memory](#configure-off-heap-memory) | [`jobmanager.memory.off-heap.size`](../config.html#jobmanager-memory-off-heap-size) | *Off-heap* memory size for job manager. This option covers all off-heap memory usage including direct and native memory allocation. [...]
| [JVM metaspace](mem_setup.html#jvm-parameters) | [`jobmanager.memory.jvm-metaspace.size`](../config.html#jobmanager-memory-jvm-metaspace-size) | Metaspace size of the Flink JVM process [...]
[flink] 05/06: [hotfix][doc-zh] Fix broken links to rocksdb state
backend section
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 59d24ac476b040d59caf8d3b46824b0be2b52b18
Author: Xintong Song <to...@gmail.com>
AuthorDate: Wed Jun 24 14:39:53 2020 +0800
[hotfix][doc-zh] Fix broken links to rocksdb state backend section
---
docs/ops/state/state_backends.zh.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/ops/state/state_backends.zh.md b/docs/ops/state/state_backends.zh.md
index 19bbf10..89744f6 100644
--- a/docs/ops/state/state_backends.zh.md
+++ b/docs/ops/state/state_backends.zh.md
@@ -94,6 +94,8 @@ FsStateBackend 适用场景:
建议同时将 [managed memory](../memory/mem_setup_tm.html#managed-memory) 设为0,以保证将最大限度的内存分配给 JVM 上的用户代码。
+<a name="the-rocksdbstatebackend" />
+
### RocksDBStateBackend
*RocksDBStateBackend* 需要配置一个文件系统的 URL (类型、地址、路径),例如:"hdfs://namenode:40010/flink/checkpoints" 或 "file:///data/flink/checkpoints"。
[flink] 01/06: [hotfix][doc] Add memory model figure for JM
detailed configuration.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 470e0ccc970fcde09d6d986596a1a4e8b8ff36ce
Author: Xintong Song <to...@gmail.com>
AuthorDate: Wed Jun 24 12:11:16 2020 +0800
[hotfix][doc] Add memory model figure for JM detailed configuration.
---
docs/ops/memory/mem_setup_jobmanager.md | 5 +++++
docs/ops/memory/mem_setup_jobmanager.zh.md | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/docs/ops/memory/mem_setup_jobmanager.md b/docs/ops/memory/mem_setup_jobmanager.md
index f0125d1..fab21a6 100644
--- a/docs/ops/memory/mem_setup_jobmanager.md
+++ b/docs/ops/memory/mem_setup_jobmanager.md
@@ -42,6 +42,11 @@ If you run the JobManager process using local [execution mode](#local-execution)
## Detailed configuration
+<center>
+ <img src="{{ site.baseurl }}/fig/process_mem_model.svg" width="300px" alt="Flink's process memory model" usemap="#process-mem-model">
+</center>
+<br />
+
The following table lists all memory components, depicted above, and references Flink configuration options which
affect the size of the respective components:
diff --git a/docs/ops/memory/mem_setup_jobmanager.zh.md b/docs/ops/memory/mem_setup_jobmanager.zh.md
index f0125d1..fab21a6 100644
--- a/docs/ops/memory/mem_setup_jobmanager.zh.md
+++ b/docs/ops/memory/mem_setup_jobmanager.zh.md
@@ -42,6 +42,11 @@ If you run the JobManager process using local [execution mode](#local-execution)
## Detailed configuration
+<center>
+ <img src="{{ site.baseurl }}/fig/process_mem_model.svg" width="300px" alt="Flink's process memory model" usemap="#process-mem-model">
+</center>
+<br />
+
The following table lists all memory components, depicted above, and references Flink configuration options which
affect the size of the respective components: