xintongsong commented on a change in pull request #9693: [FLINK-13984] Separate on-heap and off-heap managed memory pools URL: https://github.com/apache/flink/pull/9693#discussion_r334223624
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/memory/MemoryManager.java ########## @@ -568,144 +569,26 @@ public int computeNumberOfPages(double fraction) { throw new IllegalArgumentException("The fraction of memory to allocate must within (0, 1]."); } + //noinspection NumericCastThatLosesPrecision return (int) (totalNumPages * fraction / numberOfSlots); } Review comment: I think the reason we had this method was not only hold the number of slots, but also hold the total number of pages. In other words, MM knows how many memory in total the slot has, which will not change when we have MM per slot. I agree that computing operator level memory budget from the slot total memory and the operator fraction is another responsibility for MM. It makes sense that MM exposes the slot total memory and operator calls a util to compute the budget from the slot total memory and the fraction. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services