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/06 12:20:00 UTC
[jira] [Resolved] (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:all-tabpanel ]
Yu Li resolved FLINK-15919.
---------------------------
Assignee: Yu Li
Resolution: Fixed
Fix in:
* release-1.10 via f4aa9f81ccc052a7802aee6ad3dfee2b2f8be514
* master via d3f53dd0865b1dc390c09566d1baa49581591e2b
> 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)