srowen commented on a change in pull request #30725:
URL: https://github.com/apache/spark/pull/30725#discussion_r546508637
##########
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:
Whether or not a limit is in place (which could also be a good back-stop
to prevent a huge cache), this could be fine - I think the only risk is that
weak references are quite readily reclaimed, so this risks losing most of the
caching.
----------------------------------------------------------------
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]