sunjincheng121 commented on a change in pull request #7797: [FLINK-11379] Fix 
OutOfMemoryError caused by Files.readAllBytes() when TM loads a large size TDD
URL: https://github.com/apache/flink/pull/7797#discussion_r259761675
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/util/FileUtils.java
 ##########
 @@ -56,6 +60,15 @@
        /** The length of the random part of the filename. */
        private static final int RANDOM_FILE_NAME_LENGTH = 12;
 
+       /**
+        * The maximum size of array to allocate for reading. See
+        * {@link java.nio.file.Files#MAX_BUFFER_SIZE} for more.
+        */
+       private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
+
+       /** The size of the buffer used for reading. */
+       private static final int BUFFER_SIZE = 4096;
 
 Review comment:
   Math.min(4096, new Long(sun.misc.VM.maxDirectMemory()).intValue()); ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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