Github user mxm commented on a diff in the pull request: https://github.com/apache/flink/pull/859#discussion_r33019549 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java --- @@ -137,7 +137,13 @@ public static long getSizeOfFreeHeapMemoryWithDefrag() { */ public static long getSizeOfFreeHeapMemory() { Runtime r = Runtime.getRuntime(); - return r.maxMemory() - r.totalMemory() + r.freeMemory(); + long maxMemory = r.maxMemory(); + if (maxMemory == Long.MAX_VALUE) { + // workaround for some JVM versions + return r.freeMemory(); --- End diff -- You're right. For a simple WordCount it works but for anything advanced, this will fail with "Too few memory segments provided".
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---