xintongsong commented on a change in pull request #9693: [FLINK-13984] Separate 
on-heap and off-heap managed memory pools
URL: https://github.com/apache/flink/pull/9693#discussion_r327980073
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/memory/MemoryManagerTest.java
 ##########
 @@ -237,4 +237,26 @@ public void testAllocateMixedMemoryType() throws 
MemoryAllocationException {
                split.put(MemoryType.OFF_HEAP, offHeapPages);
                return split;
        }
+
+       @Test
+       public void testMemoryReservation() throws MemoryAllocationException {
+               Object owner = new Object();
+
+               memoryManager.reserveMemory(owner, MemoryType.HEAP, PAGE_SIZE);
+               memoryManager.reserveMemory(owner, MemoryType.OFF_HEAP, 
memoryManager.getMemorySizeByType(MemoryType.OFF_HEAP));
 
 Review comment:
   I would suggest to validate that after reserving all the off-heap memory, we 
cannot reserve even one more byte off-heap memory from the memory manager. This 
could prove that the first call of reserving takes effect.
   
   And I also suggest adding test cases to verify that reserving and segment 
allocation shares the same budget / quota.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to