Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/1165#discussion_r14802119
--- Diff: core/src/main/scala/org/apache/spark/storage/MemoryStore.scala ---
@@ -22,23 +22,37 @@ import java.util.LinkedHashMap
import scala.collection.mutable.ArrayBuffer
+import org.apache.spark.SparkEnv
import org.apache.spark.util.{SizeEstimator, Utils}
+import org.apache.spark.util.collection.SizeTrackingAppendOnlyBuffer
private case class MemoryEntry(value: Any, size: Long, deserialized:
Boolean)
/**
- * Stores blocks in memory, either as ArrayBuffers of deserialized Java
objects or as
+ * Stores blocks in memory, either as Arrays of deserialized Java objects
or as
* serialized ByteBuffers.
*/
-private class MemoryStore(blockManager: BlockManager, maxMemory: Long)
+private[spark] class MemoryStore(blockManager: BlockManager, maxMemory:
Long)
extends BlockStore(blockManager) {
+ private val conf = blockManager.conf
private val entries = new LinkedHashMap[BlockId, MemoryEntry](32, 0.75f,
true)
+
@volatile private var currentMemory = 0L
- // Object used to ensure that only one thread is putting blocks and if
necessary, dropping
- // blocks from the memory store.
+
+ // Object used to ensure that only one thread is putting blocks and if
necessary,
+ // dropping blocks from the memory store.
private val putLock = new Object()
+ /**
+ * The amount of space ensured for unfolding values in memory, shared
across all cores.
+ * This space is not reserved in advance, but allocated dynamically by
dropping existing blocks.
+ */
+ private val globalBufferMemory = {
+ val bufferFraction = conf.getDouble("spark.storage.bufferFraction",
0.2)
--- End diff --
I noticed this isn't documented - is that intentional?
---
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.
---