You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yu Li (Jira)" <ji...@apache.org> on 2020/02/05 12:17:00 UTC
[jira] [Commented] (FLINK-15919) MemoryManager shouldn't allow
releasing more memory than reserved
[ https://issues.apache.org/jira/browse/FLINK-15919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17030611#comment-17030611 ]
Yu Li commented on FLINK-15919:
-------------------------------
[~trohrmann] [~sewen] FYI. Please help decide whether this is a blocker for 1.10.0 or it's ok to fix in later versions. Thanks.
> 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
> Priority: Critical
>
> Currently {{MemoryManager}} allows releasing more memory than reserved for an 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.getMemorySizeByType(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.getMemorySizeByType(MemoryType.HEAP);
> assertEquals("Memory leak happens", totalHeapMemorySize - PAGE_SIZE, heapMemoryLeft);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)