This is an automated email from the ASF dual-hosted git repository.

trohrmann pushed a commit to branch release-1.10
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.10 by this push:
     new d6778b3  [FLINK-14038][docs] Extend Application Profiling documentation
d6778b3 is described below

commit d6778b3b95d1e72664b9e6f24b65420054816023
Author: Till Rohrmann <[email protected]>
AuthorDate: Thu Feb 20 19:00:37 2020 +0100

    [FLINK-14038][docs] Extend Application Profiling documentation
    
    This commit adds explanations on how to analyze/debug out of memory 
problems and
    how to analyze GC behaviour.
    
    This closes #11165.
---
 docs/monitoring/application_profiling.md    | 34 ++++++++++++++++++++++++++---
 docs/monitoring/application_profiling.zh.md | 32 +++++++++++++++++++++++++--
 2 files changed, 61 insertions(+), 5 deletions(-)

diff --git a/docs/monitoring/application_profiling.md 
b/docs/monitoring/application_profiling.md
index 2a3feea..3fe0adb 100644
--- a/docs/monitoring/application_profiling.md
+++ b/docs/monitoring/application_profiling.md
@@ -1,5 +1,5 @@
 ---
-title: "Application Profiling"
+title: "Application Profiling & Debugging"
 nav-parent_id: monitoring
 nav-pos: 15
 ---
@@ -33,7 +33,7 @@ user in `env.java.opts`, `env.java.opts.jobmanager`, 
`env.java.opts.taskmanager`
 use of the script variable `FLINK_LOG_PREFIX` and by enclosing the options in 
double quotes for late evaluation. Log files
 using `FLINK_LOG_PREFIX` are rotated along with the default `.out` and `.log` 
files.
 
-# Profiling with Java Flight Recorder
+## Profiling with Java Flight Recorder
 
 Java Flight Recorder is a profiling and event collection framework built into 
the Oracle JDK.
 [Java Mission 
Control](http://www.oracle.com/technetwork/java/javaseproducts/mission-control/java-mission-control-1998576.html)
@@ -44,7 +44,7 @@ Flight Recorder. Example configuration:
 env.java.opts: "-XX:+UnlockCommercialFeatures -XX:+UnlockDiagnosticVMOptions 
-XX:+FlightRecorder -XX:+DebugNonSafepoints 
-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=${FLINK_LOG_PREFIX}.jfr"
 {% endhighlight %}
 
-# Profiling with JITWatch
+## Profiling with JITWatch
 
 [JITWatch](https://github.com/AdoptOpenJDK/jitwatch/wiki) is a log analyser 
and visualizer for the Java HotSpot JIT
 compiler used to inspect inlining decisions, hot methods, bytecode, and 
assembly. Example configuration:
@@ -53,4 +53,32 @@ compiler used to inspect inlining decisions, hot methods, 
bytecode, and assembly
 env.java.opts: "-XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading 
-XX:+LogCompilation -XX:LogFile=${FLINK_LOG_PREFIX}.jit -XX:+PrintAssembly"
 {% endhighlight %}
 
+## Analyzing Out of Memory Problems
+
+If you encounter `OutOfMemoryExceptions` with your Flink application, then it 
is a good idea to enable heap dumps on out of memory errors.
+
+{% highlight yaml %}
+env.java.opts: "-XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=${FLINK_LOG_PREFIX}.hprof"
+{% endhighlight %}
+
+The heap dump will allow you to analyze potential memory leaks in your user 
code.
+If the memory leak should be caused by Flink, then please reach out to the 
[dev mailing list](mailto:[email protected]).
+
+## Analyzing Memory & Garbage Collection Behaviour
+
+Memory usage and garbage collection can have a profound impact on your 
application.
+The effects can range from slight performance degradation to a complete 
cluster failure if the GC pauses are too long.
+If you want to better understand the memory and GC behaviour of your 
application, then you can enable memory logging on the `TaskManagers`.
+
+{% highlight yaml %}
+taskmanager.debug.memory.log: true
+taskmanager.debug.memory.log-interval: 10000 // 10s interval
+{% endhighlight %}
+
+If you are interested in more detailed GC statistics, then you can activate 
the JVM's GC logging via:
+
+{% highlight yaml %}
+env.java.opts: "-Xloggc:${FLINK_LOG_PREFIX}.gc.log 
-XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDetails -XX:+PrintGCDateStamps 
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M 
-XX:+PrintPromotionFailure -XX:+PrintGCCause"
+{% endhighlight %}
+
 {% top %}
diff --git a/docs/monitoring/application_profiling.zh.md 
b/docs/monitoring/application_profiling.zh.md
index c766164..6061f21 100644
--- a/docs/monitoring/application_profiling.zh.md
+++ b/docs/monitoring/application_profiling.zh.md
@@ -33,7 +33,7 @@ user in `env.java.opts`, `env.java.opts.jobmanager`, 
`env.java.opts.taskmanager`
 use of the script variable `FLINK_LOG_PREFIX` and by enclosing the options in 
double quotes for late evaluation. Log files
 using `FLINK_LOG_PREFIX` are rotated along with the default `.out` and `.log` 
files.
 
-# Profiling with Java Flight Recorder
+## Profiling with Java Flight Recorder
 
 Java Flight Recorder is a profiling and event collection framework built into 
the Oracle JDK.
 [Java Mission 
Control](http://www.oracle.com/technetwork/java/javaseproducts/mission-control/java-mission-control-1998576.html)
@@ -44,7 +44,7 @@ Flight Recorder. Example configuration:
 env.java.opts: "-XX:+UnlockCommercialFeatures -XX:+UnlockDiagnosticVMOptions 
-XX:+FlightRecorder -XX:+DebugNonSafepoints 
-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=${FLINK_LOG_PREFIX}.jfr"
 {% endhighlight %}
 
-# Profiling with JITWatch
+## Profiling with JITWatch
 
 [JITWatch](https://github.com/AdoptOpenJDK/jitwatch/wiki) is a log analyser 
and visualizer for the Java HotSpot JIT
 compiler used to inspect inlining decisions, hot methods, bytecode, and 
assembly. Example configuration:
@@ -53,4 +53,32 @@ compiler used to inspect inlining decisions, hot methods, 
bytecode, and assembly
 env.java.opts: "-XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading 
-XX:+LogCompilation -XX:LogFile=${FLINK_LOG_PREFIX}.jit -XX:+PrintAssembly"
 {% endhighlight %}
 
+## Analyzing Out of Memory Problems
+
+If you encounter `OutOfMemoryExceptions` with your Flink application, then it 
is a good idea to enable heap dumps on out of memory errors.
+
+{% highlight yaml %}
+env.java.opts: "-XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=${FLINK_LOG_PREFIX}.hprof"
+{% endhighlight %}
+
+The heap dump will allow you to analyze potential memory leaks in your user 
code.
+If the memory leak should be caused by Flink, then please reach out to the 
[dev mailing list](mailto:[email protected]).
+
+## Analyzing Memory & Garbage Collection Behaviour
+
+Memory usage and garbage collection can have a profound impact on your 
application.
+The effects can range from slight performance degradation to a complete 
cluster failure if the GC pauses are too long.
+If you want to better understand the memory and GC behaviour of your 
application, then you can enable memory logging on the `TaskManagers`.
+
+{% highlight yaml %}
+taskmanager.debug.memory.log: true
+taskmanager.debug.memory.log-interval: 10000 // 10s interval
+{% endhighlight %}
+
+If you are interested in more detailed GC statistics, then you can activate 
the JVM's GC logging via:
+
+{% highlight yaml %}
+env.java.opts: "-Xloggc:${FLINK_LOG_PREFIX}.gc.log 
-XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDetails -XX:+PrintGCDateStamps 
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M 
-XX:+PrintPromotionFailure -XX:+PrintGCCause"
+{% endhighlight %}
+
 {% top %}

Reply via email to