azagrebin 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_r334087470
##########
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 still think that the fraction concern is not strictly related to the
memory management per se but it is rather a higher level concern about how the
memory is distributed among the operators. I think the main reason we had this
method was even to hold the number of slots which should go away when the
memory manager is per slot.
Fractions and the memory limits can be handled in one place where the
operators get the memory manager and their limits which they can decide how to
break into chunks and pages.
Anyways, I agree we can reiterate on this later during the MM per slot
refactoring.
Instead, I suggest we expose the total number of pages per type at the
moment, same as memory size per type which is naturally related to the memory
management.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services