Skip to content

Commit afd36d6

Browse files
ShubhamGupta29ShubhamGupta29
authored andcommitted
Adding check if ParallelGc is enabled
1 parent d136e7a commit afd36d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/com/linkedin/drelephant/spark/heuristics/ExecutorGcHeuristic.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ExecutorGcHeuristic(private val heuristicConfigurationData: HeuristicConfi
5656
//adding recommendations to the result, severityTimeA corresponds to the ascending severity calculation
5757
if (evaluator.severityTimeA.getValue > Severity.LOW.getValue) {
5858
resultDetails = resultDetails :+ new HeuristicResultDetails("Gc ratio high",
59-
"The job is spending too much time on GC. Recommended to increase the executor memory and also can enable ParallelGC using spark.executor.extraJavaOptions or reducing number of UDF calls.")
59+
"The job is spending too much time on GC. Recommended to increase the executor memory." + evaluator.parallelGcRecommendation + "Can also try reducing number of UDF calls.")
6060
}
6161
//severityTimeD corresponds to the descending severity calculation
6262
if (evaluator.severityTimeD.getValue > Severity.LOW.getValue) {
@@ -104,6 +104,9 @@ object ExecutorGcHeuristic {
104104
throw new Exception("No executor information available.")
105105
}
106106

107+
val isParallelGcEnabled: Boolean = appConfigurationProperties.getOrElse("spark.executor.extraJavaOptions","").contains("XX:+UseParallelGC")
108+
val parallelGcRecommendation: String = if (isParallelGcEnabled) "" else "Enable ParallelGc using spark.executor.extraJavaOptions."
109+
107110
lazy val appConfigurationProperties: Map[String, String] =
108111
data.appConfigurationProperties
109112
var (jvmTime, executorRunTimeTotal) = getTimeValues(executorSummaries)

0 commit comments

Comments
 (0)