Github user ajbozarth commented on a diff in the pull request: https://github.com/apache/spark/pull/14673#discussion_r75190822 --- Diff: core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala --- @@ -137,6 +139,17 @@ class JobProgressListener(conf: SparkConf) extends SparkListener with Logging { ) } + /** If Tasks is too large, remove and garbage collect old tasks */ + private def trimTasksIfNecessary(taskData: HashMap[Long, TaskUIData]) = synchronized { + if (taskData.size > retainedTasks) { + val toRemove = (taskData.size - retainedTasks) + val oldIds = taskData.map(_._2.taskInfo.taskId).toList.sorted.take(toRemove) --- End diff -- This code is from the original pr, I didn't know _._1 is always equal to _._2.taskInfo.taskId so I'll change that, as for the loop, it does slow things down, I noticed it in my testing, I'll look at a better way to do this.
--- 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. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org