xintongsong commented on a change in pull request #15224:
URL: https://github.com/apache/flink/pull/15224#discussion_r594840818



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/memory/UnsafeMemoryBudget.java
##########
@@ -213,4 +213,16 @@ void releaseMemory(@Nonnegative long size) {
                             size, currentAvailableMemorySize, 
totalMemorySize));
         }
     }
+
+    /**
+     * Return an runnable to postpone memory release.
+     *
+     * <p>The returned runnable could be safely referenced by possible gc 
cleaner action without
+     * worrying about cycle reference back to memory manager.
+     */
+    Runnable cleanupMemory(@Nonnegative long size) {

Review comment:
       I'd suggest to call this `getReleaseMemoryAction` or 
`getCleanupMemoryAction`.
   Instead of performing an action, this method generates an action that can be 
performed later.




----------------------------------------------------------------
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]


Reply via email to