tillrohrmann commented on a change in pull request #11109:
[FLINK-15758][MemManager] Release segment and its unsafe memory in GC Cleaner
URL: https://github.com/apache/flink/pull/11109#discussion_r410251612
##########
File path:
flink-core/src/main/java/org/apache/flink/util/JavaGcCleanerWrapper.java
##########
@@ -70,35 +70,46 @@ public static Runnable create(Object owner, Runnable
cleanOperation) {
return CLEANER_FACTORY.create(owner, cleanOperation);
}
+ public static boolean waitForGcToRunReadyCleaners() throws
InterruptedException {
+ return CLEANER_FACTORY.waitForGcToRunReadyCleaners();
+ }
+
+ private static Class<?> findClass(String className, String
errorMessage) {
+ try {
+ return Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ throw new FlinkRuntimeException(errorMessage, e);
+ }
+ }
+
@FunctionalInterface
private interface CleanerProvider {
CleanerFactory createCleanerFactory() throws
ClassNotFoundException;
}
- @FunctionalInterface
private interface CleanerFactory {
Runnable create(Object owner, Runnable cleanOperation);
+
+ boolean waitForGcToRunReadyCleaners() throws
InterruptedException;
Review comment:
I think this method does not belong to the `CleanerFactory`. If you take a
look at the implementations of the `CleanerFactory` methods, then one sees that
both interface methods are completely disjunct. I would suggest to introduce a
separate type for it.
----------------------------------------------------------------
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