[
https://issues.apache.org/jira/browse/FLINK-14974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16983604#comment-16983604
]
Chesnay Schepler commented on FLINK-14974:
------------------------------------------
Sounds good.
> Managed memory fractions should be rounded properly to not summed up to be
> more than 1.0
> ----------------------------------------------------------------------------------------
>
> Key: FLINK-14974
> URL: https://issues.apache.org/jira/browse/FLINK-14974
> Project: Flink
> Issue Type: Sub-task
> Components: Runtime / Coordination
> Affects Versions: 1.10.0
> Reporter: Zhu Zhu
> Priority: Major
> Fix For: 1.10.0
>
>
> Managed memory fractions should be rounded to floor at a certain precision
> when divided by the number of operators, otherwise the fractions can be
> summed up to be more than 1.0 due to the double precision issue, and the last
> operator may fail to allocate managed memory it is supposed to be able to
> acquire.
> To achieve that, I think we should change
> {{StreamingJobGraphGenerator#setManagedMemoryFractionForOperator}} to use
> BigDecimal#divide(otherValue, scale, RoundMode.ROUND_DOWN) to calculate the
> fractions. In this way, the sum of the fractions will not exceed 1.0.
> The scale can be a bit larger (maybe 16) so that we only lose little managed
> memory.
> cc [~chesnay]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)