[ 
https://issues.apache.org/jira/browse/FLINK-15919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Yao updated FLINK-15919:
-----------------------------
    Fix Version/s:     (was: 1.10.1)
                       (was: 1.11.0)

> MemoryManager shouldn't allow releasing more memory than reserved
> -----------------------------------------------------------------
>
>                 Key: FLINK-15919
>                 URL: https://issues.apache.org/jira/browse/FLINK-15919
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Task
>    Affects Versions: 1.10.0
>            Reporter: Yu Li
>            Assignee: Yu Li
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently {{MemoryManager}} allows releasing more memory than reserved for 
> the same owner object, which could be reproduced by adding below test case 
> into {{MemoryManagerTest}}:
> {code}
>       @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);
>       }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to