cxzl25 commented on a change in pull request #30725:
URL: https://github.com/apache/spark/pull/30725#discussion_r544143219
##########
File path: core/src/main/scala/org/apache/spark/SparkEnv.scala
##########
@@ -74,10 +74,10 @@ class SparkEnv (
@volatile private[spark] var isStopped = false
private val pythonWorkers = mutable.HashMap[(String, Map[String, String]),
PythonWorkerFactory]()
- // A general, soft-reference map for metadata needed during HadoopRDD split
computation
- // (e.g., HadoopFileRDD uses this to cache JobConfs and InputFormats).
+ // A general, weak-reference map for metadata needed during HadoopRDD split
computation
+ // (e.g., HadoopRDD uses this to cache JobConfs).
private[spark] val hadoopJobMetadata =
- CacheBuilder.newBuilder().softValues().build[String, AnyRef]().asMap()
+ CacheBuilder.newBuilder().weakValues().build[String, AnyRef]().asMap()
Review comment:
Use limited size, soft-reference cache can reduce the number of YGC than
weak-reference.
But what size should it be limited to?
In fact, the driver rarely has the opportunity to reuse the jobconf of the
cache, and it makes sense to share the jobconf in the executor.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]