Skip to content

Commit 184048f

Browse files
committed
[SPARK-2856] Decrease initial buffer size for Kryo to 64KB.
Author: Reynold Xin <[email protected]> Closes #1780 from rxin/kryo-init-size and squashes the following commits: 551b935 [Reynold Xin] [SPARK-2856] Decrease initial buffer size for Kryo to 64KB.
1 parent 9862c61 commit 184048f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ class KryoSerializer(conf: SparkConf)
4747
with Logging
4848
with Serializable {
4949

50-
private val bufferSize = conf.getInt("spark.kryoserializer.buffer.mb", 2) * 1024 * 1024
50+
private val bufferSize =
51+
(conf.getDouble("spark.kryoserializer.buffer.mb", 0.064) * 1024 * 1024).toInt
52+
5153
private val maxBufferSize = conf.getInt("spark.kryoserializer.buffer.max.mb", 64) * 1024 * 1024
5254
private val referenceTracking = conf.getBoolean("spark.kryo.referenceTracking", true)
5355
private val registrationRequired = conf.getBoolean("spark.kryo.registrationRequired", false)

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ Apart from these, the following properties are also available, and may be useful
412412
</tr>
413413
<tr>
414414
<td><code>spark.kryoserializer.buffer.mb</code></td>
415-
<td>2</td>
415+
<td>0.064</td>
416416
<td>
417417
Initial size of Kryo's serialization buffer, in megabytes. Note that there will be one buffer
418418
<i>per core</i> on each worker. This buffer will grow up to

0 commit comments

Comments
 (0)