Skip to content

Commit

Permalink
Fix memory accounting in ParallelHashBuildOperator
Browse files Browse the repository at this point in the history
Use same logic as for HashBuilderOperator
  • Loading branch information
pnowojski authored and dain committed Sep 9, 2016
1 parent 8a8344f commit e669bd5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ public void addInput(Page page)
checkState(!isFinished(), "Operator is already finished");

index.addPage(page);

operatorContext.setMemoryReservation(page.getPositionCount());
if (!operatorContext.trySetMemoryReservation(index.getEstimatedSize().toBytes())) {
index.compact();
}
operatorContext.setMemoryReservation(index.getEstimatedSize().toBytes());
operatorContext.recordGeneratedOutput(page.getSizeInBytes(), page.getPositionCount());
}

Expand Down

0 comments on commit e669bd5

Please sign in to comment.