Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
1.10.0
Description
Currently MemoryManager allows releasing more memory than reserved for the same owner object, which could be reproduced by adding below test case into MemoryManagerTest:
@Test public void testMemoryReleaseGuard() throws MemoryReservationException { Object owner = new Object(); Object owner2 = new Object(); long totalHeapMemorySize = memoryManager.availableMemory(MemoryType.HEAP); memoryManager.reserveMemory(owner, MemoryType.HEAP, PAGE_SIZE); memoryManager.reserveMemory(owner2, MemoryType.HEAP, PAGE_SIZE); memoryManager.releaseMemory(owner, MemoryType.HEAP, PAGE_SIZE); memoryManager.releaseMemory(owner, MemoryType.HEAP, PAGE_SIZE); long heapMemoryLeft = memoryManager.availableMemory(MemoryType.HEAP); assertEquals("Memory leak happens", totalHeapMemorySize - PAGE_SIZE, heapMemoryLeft); memoryManager.releaseAllMemory(owner2, MemoryType.HEAP); }
Attachments
Issue Links
- links to