Reset memory revocation listener when OperatorContext is destroyed
resetMemoryRevocationRequestListener should be reset on
OperatorContext destroy. Otherwise OperatorContext holds
reference to Driver and Operator instances thus consuming memory.
@@ -316,6 +316,11 @@ public class OperatorContext
public void destroy()
{
+ // reset memory revocation listener so that OperatorContext doesn't hold any references to Driver instance
+ synchronized (this) {
+ memoryRevocationRequestListener = null;
+ }
+
operatorMemoryContext.close();
if (operatorMemoryContext.getSystemMemory() != 0) {
