Search in sources :

Example 1 with ResultMergeMemoryManager

use of io.mycat.memory.unsafe.memory.mm.ResultMergeMemoryManager in project Mycat-Server by MyCATApache.

the class TaskMemoryManagerSuite method leakedPageMemoryIsDetected.

@Test
public void leakedPageMemoryIsDetected() {
    final DataNodeMemoryManager manager = new DataNodeMemoryManager(new ResultMergeMemoryManager(new MycatPropertyConf().set("mycat.memory.offHeap.enabled", "false").set("mycat.memory.offHeap.size", "32768"), 1, Long.MAX_VALUE), 0);
    // leak memory
    manager.allocatePage(4096, null);
    Assert.assertEquals(4096, manager.getMemoryConsumptionForThisConnection());
    Assert.assertEquals(4096, manager.cleanUpAllAllocatedMemory());
}
Also used : DataNodeMemoryManager(io.mycat.memory.unsafe.memory.mm.DataNodeMemoryManager) ResultMergeMemoryManager(io.mycat.memory.unsafe.memory.mm.ResultMergeMemoryManager) MycatPropertyConf(io.mycat.memory.unsafe.utils.MycatPropertyConf) Test(org.junit.Test)

Aggregations

DataNodeMemoryManager (io.mycat.memory.unsafe.memory.mm.DataNodeMemoryManager)1 ResultMergeMemoryManager (io.mycat.memory.unsafe.memory.mm.ResultMergeMemoryManager)1 MycatPropertyConf (io.mycat.memory.unsafe.utils.MycatPropertyConf)1 Test (org.junit.Test)1