SimpleMemoryAllocatorImpl ma = SimpleMemoryAllocatorImpl.create(new NullOutOfOffHeapMemoryListener(), new NullOffHeapMemoryStats(), new UnsafeMemoryChunk[]{slab}); assertEquals(TOTAL_MEM, ma.getFreeMemory()); assertEquals(TOTAL_MEM, ma.getFreeList().getFreeFragmentMemory()); assertEquals(0, ma.getFreeList().getFreeTinyMemory()); long freeSlab = ma.getFreeList().getFreeFragmentMemory(); long oldFreeHugeMemory = ma.getFreeList().getFreeHugeMemory(); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*(BATCH_SIZE-1), oldFreeHugeMemory); assertEquals(TOTAL_MEM, ma.getFreeMemory()); assertEquals(freeSlab, ma.getFreeList().getFreeFragmentMemory()); tinymc = ma.allocate(1, null); assertEquals(round(TINY_MULTIPLE, 1+perObjectOverhead), tinymc.getSize()); assertEquals(freeSlab-(round(TINY_MULTIPLE, 1+perObjectOverhead)*BATCH_SIZE), ma.getFreeList().getFreeFragmentMemory()); freeSlab = ma.getFreeList().getFreeFragmentMemory(); tinymc.release(); assertEquals(round(TINY_MULTIPLE, maxTiny+perObjectOverhead)+(round(TINY_MULTIPLE, 1+perObjectOverhead)*BATCH_SIZE), ma.getFreeList().getFreeTinyMemory()-oldFreeTinyMemory);