You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/04 06:08:53 UTC

[GitHub] [flink] zhuzhurk commented on a change in pull request #10396: [FLINK-14063][table-planner-blink] Operators use fractions to decide how many managed memory to allocate

zhuzhurk commented on a change in pull request #10396: [FLINK-14063][table-planner-blink] Operators use fractions to decide how many managed memory to allocate
URL: https://github.com/apache/flink/pull/10396#discussion_r353563264
 
 

 ##########
 File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/TableStreamOperator.java
 ##########
 @@ -46,4 +47,13 @@ public void dispose() throws Exception {
 		super.dispose();
 	}
 
+	/**
+	 * Compute memory size from memory faction.
+	 */
+	public long computeMemorySize() {
+		double memFraction = getOperatorConfig().getManagedMemoryFractionOnHeap() +
+				getOperatorConfig().getManagedMemoryFractionOffHeap();
+		MemoryManager memManager = getContainingTask().getEnvironment().getMemoryManager();
+		return ((long) memManager.computeNumberOfPages(memFraction)) * memManager.getPageSize();
 
 Review comment:
   you can use `MemoryManager#computeMemorySize` if you want the memory size directly.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services