[MINOR][TEST] Off -heap memory leaks for unit tests

## What changes were proposed in this pull request?
Free off -heap memory .
I have checked all the unit tests.

## How was this patch tested?
N/A

Author: liuxian <liu.xian3@zte.com.cn>

Closes #19075 from 10110346/memleak.
This commit is contained in:
liuxian 2017-08-30 10:16:11 +01:00 committed by Sean Owen
parent e47f48c737
commit d4895c9de6
2 changed files with 2 additions and 0 deletions

View file

@ -73,5 +73,6 @@ public class PlatformUtilSuite {
Assert.assertEquals(
Platform.getByte(offheap.getBaseObject(), offheap.getBaseOffset()),
MemoryAllocator.MEMORY_DEBUG_FILL_CLEAN_VALUE);
MemoryAllocator.UNSAFE.free(offheap);
}
}

View file

@ -54,6 +54,7 @@ public class TaskMemoryManagerSuite {
final long encodedAddress = manager.encodePageNumberAndOffset(dataPage, offset);
Assert.assertEquals(null, manager.getPage(encodedAddress));
Assert.assertEquals(offset, manager.getOffsetInPage(encodedAddress));
manager.freePage(dataPage, c);
}
@Test