assertEquals(0, ma.getFreeList().getFreeTinyMemory()); assertEquals(0, ma.getFreeList().getFreeHugeMemory()); MemoryChunk tinymc = ma.allocate(maxTiny, null); assertEquals(TOTAL_MEM-round(TINY_MULTIPLE, maxTiny+perObjectOverhead), ma.getFreeMemory()); long oldFreeHugeMemory = ma.getFreeList().getFreeHugeMemory(); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*(BATCH_SIZE-1), oldFreeHugeMemory); hugemc.release(); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead), ma.getFreeList().getFreeHugeMemory()-oldFreeHugeMemory); assertEquals(oldFreeHugeMemory, ma.getFreeList().getFreeHugeMemory()); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead), ma.getFreeList().getFreeHugeMemory()-oldFreeHugeMemory); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*(BATCH_SIZE-1), ma.getFreeList().getFreeHugeMemory()); hugemc.release(); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*BATCH_SIZE, ma.getFreeList().getFreeHugeMemory()); hugemc = ma.allocate(minHuge, null); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*(BATCH_SIZE-1), ma.getFreeList().getFreeHugeMemory()); if (BATCH_SIZE > 1) { MemoryChunk hugemc2 = ma.allocate(minHuge, null); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*(BATCH_SIZE-2), ma.getFreeList().getFreeHugeMemory()); hugemc2.release(); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*(BATCH_SIZE-1), ma.getFreeList().getFreeHugeMemory()); assertEquals(round(TINY_MULTIPLE, minHuge+perObjectOverhead)*BATCH_SIZE, ma.getFreeList().getFreeHugeMemory());