Skip to content

Commit 9cb9d72

Browse files
jiangxb1987gatorsmile
authored andcommitted
[SPARK-25114][2.3][CORE][FOLLOWUP] Fix RecordBinaryComparatorSuite build failure
## What changes were proposed in this pull request? Fix RecordBinaryComparatorSuite build failure ## How was this patch tested? Existing tests. Closes #22166 from jiangxb1987/SPARK-25114-2.3. Authored-by: Xingbo Jiang <xingbo.jiang@databricks.com> Signed-off-by: Xiao Li <gatorsmile@gmail.com>
1 parent 8bde467 commit 9cb9d72

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/src/test/java/org/apache/spark/memory/TestMemoryConsumer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
import java.io.IOException;
2121

22+
import org.apache.spark.unsafe.memory.MemoryBlock;
23+
2224
public class TestMemoryConsumer extends MemoryConsumer {
2325
public TestMemoryConsumer(TaskMemoryManager memoryManager, MemoryMode mode) {
2426
super(memoryManager, 1024L, mode);
@@ -43,6 +45,11 @@ void free(long size) {
4345
used -= size;
4446
taskMemoryManager.releaseExecutionMemory(size, this);
4547
}
48+
49+
public void freePage(MemoryBlock page) {
50+
used -= page.size();
51+
taskMemoryManager.freePage(page, this);
52+
}
4653
}
4754

4855

0 commit comments

Comments
 (0)