Github user rekhajoshm commented on a diff in the pull request:
https://github.com/apache/spark/pull/7602#discussion_r35510171
--- Diff:
core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala ---
@@ -181,17 +181,26 @@ private[ui] object RDDOperationGraph extends Logging {
}
/** Return the dot representation of a subgraph in an RDDOperationGraph.
*/
- private def makeDotSubgraph(cluster: RDDOperationCluster, indent:
String): String = {
+ private def makeDotSubgraph(cluster: RDDOperationCluster, indent:
StringBuilder): String = {
val subgraph = new StringBuilder
- subgraph.append(indent + s"subgraph cluster${cluster.id} {\n")
- subgraph.append(indent + s""" label="${cluster.name}";\n""")
- cluster.childNodes.foreach { node =>
- subgraph.append(indent + s" ${makeDotNode(node)};\n")
- }
- cluster.childClusters.foreach { cscope =>
- subgraph.append(makeDotSubgraph(cscope, indent + " "))
+ try {
+ subgraph.append(indent).append(s"subgraph cluster${cluster.id} {\n")
+ subgraph.append(indent).append(s""" label="${cluster.name}";\n""")
+ cluster.childNodes.foreach { node =>
+ subgraph.append(indent).append(s" ${makeDotNode(node)};\n")
+ }
+ cluster.childClusters.foreach { cscope =>
+ subgraph.append(makeDotSubgraph(cscope, indent.append(" ")))
+ }
+ subgraph.append(indent).append("}\n")
+ subgraph.toString()
+ } catch {
+ case oom: OutOfMemoryError =>
--- End diff --
Hi @JoshRosen - The essential fix I did was to use same stringbuilder
object rather than creating multiple string/stringbuilders within loop which
caused oom/heap issue.However have added SparkException just incase. Can you
please review? Thanks!
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]