azagrebin commented on a change in pull request #12516:
URL: https://github.com/apache/flink/pull/12516#discussion_r436507237



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/jobmanager/JobManagerFlinkMemoryUtils.java
##########
@@ -88,16 +88,16 @@ private static void verifyJvmHeapSize(MemorySize 
jvmHeapSize) {
                }
        }
 
-       private static void verifyJobStoreCacheSize(Configuration config, 
MemorySize jvmHeapSize) {
+       private static void verifyJobStoreCacheSize(Configuration config, 
MemorySize offHeapMemorySize) {

Review comment:
       This method is correct as the job cache is part of the JVM heap, not 
off-heap.
   The problem is that `verifyJobStoreCacheSize` is called with `offHeapMemory` 
in `JobManagerFlinkMemoryUtils#createJobManagerFlinkMemory`:
   `verifyJobStoreCacheSize(config, offHeapMemory);`
   which should be:
   `verifyJobStoreCacheSize(config, jvmHeap);` there.

##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerProcessUtilsTest.java
##########
@@ -69,6 +69,20 @@ public void testConfigOffHeapMemory() {
                        jobManagerProcessSpec -> 
assertThat(jobManagerProcessSpec.getJvmDirectMemorySize(), is(offHeapMemory)));
        }
 
+       @Test
+       public void testConfigJvmHeapAndOffHeapMemory() {

Review comment:
       This test tests 2 things: heap and off-heap settings.
   Also, I think it is redundant as it is duplicated with 
`testConfigJvmHeapMemory` and `testConfigOffHeapMemory`




----------------------------------------------------------------
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]


Reply via email to