tillrohrmann commented on a change in pull request #9703: [FLINK-14038]Add 
default GC options for flink on yarn to facilitate debugging
URL: https://github.com/apache/flink/pull/9703#discussion_r341642848
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/BootstrapToolsTest.java
 ##########
 @@ -140,16 +140,38 @@ public void testSubstituteConfigKeyPrefix() {
                }
        }
 
+  public static String getGCLoggingOpts(String logDirectory) {
+                       return "-Xloggc:" + logDirectory + "/gc.log " +
+                       "-XX:+PrintGCApplicationStoppedTime " +
+                       "-XX:+PrintGCDetails " +
+                       "-XX:+PrintGCDateStamps " +
+                       "-XX:+UseGCLogFileRotation " +
+                       "-XX:NumberOfGCLogFiles=10 " +
+                       "-XX:GCLogFileSize=10M " +
+                       "-XX:+PrintPromotionFailure " +
+                       "-XX:+PrintGCCause";
+  }
+
+  public static String getHeapdumpOpts(String appId, String ident, String 
logDirectory, String heapdumpDir) {
+                       return String.format("-XX:+HeapDumpOnOutOfMemoryError " 
+
+                               "-XX:HeapDumpPath=%s/%s-flink-%s-heapdump.hprof 
" +
+                               "-XX:OnOutOfMemoryError=\"echo -e 
'OutOfMemoryError! Killing current process %%p...\nCheck gc logs and heapdump 
file(%s/%s-flink-%s-heapdump.hprof) for details.' > " +
+                               "%s/%s.err; kill -9 %%p\"", heapdumpDir, appId, 
ident, heapdumpDir, appId, ident, logDirectory, ident);
+  }
 
 Review comment:
   I guess we could simply use the methods in the `BootstrapTools` for this.

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