[
https://issues.apache.org/jira/browse/FLINK-18353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142945#comment-17142945
]
Andrey Zagrebin commented on FLINK-18353:
-----------------------------------------
[~stevenz3wu] thanks for your insight about estimation of direct memory limit.
I am not an expert in how akka/netty internally works. If you look into [Akka
configuration
specification|https://doc.akka.io/docs/akka/2.5.31/general/configuration.html],
there are 'send/receive-buffer-sizes' to configure. The message size
('akka.framesize') affects them only for UDP. From what I see in Flink code, we
use TCP. Therefore, it could be that the full message is on heap and it gets
written into direct buffers in chunks. If so then 'send(receive)-buffer-size'
should be used for
direct memory limit estimation (probably per connection, so parallelism then
matters). I do not see that we touch 'send(receive)-buffer-size' in Flink code,
I assume they have default sizes.
> [1.11.0] maybe document jobmanager behavior change regarding
> -XX:MaxDirectMemorySize
> ------------------------------------------------------------------------------------
>
> Key: FLINK-18353
> URL: https://issues.apache.org/jira/browse/FLINK-18353
> Project: Flink
> Issue Type: Improvement
> Components: Documentation, Runtime / Configuration
> Affects Versions: 1.11.0
> Reporter: Steven Zhen Wu
> Assignee: Andrey Zagrebin
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.11.0
>
>
> I know FLIP-116 (Unified Memory Configuration for Job Managers) is introduced
> in 1.11. That does cause a small behavior change regarding
> `-XX:MaxDirectMemorySize`. Previously, jobmanager don't set JVM arg
> `-XX:MaxDirectMemorySize`, which means JVM can use up to -`Xmx` size for
> direct memory. Now `-XX:MaxDirectMemorySize` is always set to
> [jobmanager.memory.off-heap.size|https://ci.apache.org/projects/flink/flink-docs-master/ops/config.html#jobmanager-memory-off-heap-size]
> config (default 128 mb).
>
> {{It is possible for jobmanager to get "java.lang.OufOfMemoryError: Direct
> Buffer Memory" without tuning
> }}{{[jobmanager.memory.off-heap.size|https://ci.apache.org/projects/flink/flink-docs-master/ops/config.html#jobmanager-memory-off-heap-size]}}
> especially for high-parallelism jobs. Previously, no tuning needed.
>
> Maybe we should point out the behavior change in the migration guide?
> [https://ci.apache.org/projects/flink/flink-docs-master/ops/memory/mem_migration.html#migrate-job-manager-memory-configuration]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)