diff --git a/presto-main/src/main/java/io/prestosql/operator/OperatorContext.java b/presto-main/src/main/java/io/prestosql/operator/OperatorContext.java index a61380ba93699..bc60dc5781589 100644 --- a/presto-main/src/main/java/io/prestosql/operator/OperatorContext.java +++ b/presto-main/src/main/java/io/prestosql/operator/OperatorContext.java @@ -260,7 +260,7 @@ public LocalMemoryContext localSystemMemoryContext() // caller shouldn't close this context as it's managed by the OperatorContext public LocalMemoryContext localRevocableMemoryContext() { - return new InternalLocalMemoryContext(operatorMemoryContext.localRevocableMemoryContext(), revocableMemoryFuture, () -> {}, false); + return new InternalLocalMemoryContext(operatorMemoryContext.localRevocableMemoryContext(), revocableMemoryFuture, this::updatePeakMemoryReservations, false); } // caller shouldn't close this context as it's managed by the OperatorContext @@ -278,7 +278,7 @@ public AggregatedMemoryContext aggregateSystemMemoryContext() // caller shouldn't close this context as it's managed by the OperatorContext public AggregatedMemoryContext aggregateRevocableMemoryContext() { - return new InternalAggregatedMemoryContext(operatorMemoryContext.aggregateRevocableMemoryContext(), memoryFuture, () -> {}, false); + return new InternalAggregatedMemoryContext(operatorMemoryContext.aggregateRevocableMemoryContext(), memoryFuture, this::updatePeakMemoryReservations, false); } // caller should close this context as it's a new context