Skip to content
Snippets Groups Projects
Commit 66f26a46 authored by Hossein's avatar Hossein Committed by Matei Zaharia
Browse files

[SPARK-2696] Reduce default value of spark.serializer.objectStreamReset

The current default value of spark.serializer.objectStreamReset is 10,000.
When trying to re-partition (e.g., to 64 partitions) a large file (e.g., 500MB), containing 1MB records, the serializer will cache 10000 x 1MB x 64 ~= 640 GB which will cause out of memory errors.

This patch sets the default value to a more reasonable default value (100).

Author: Hossein <hossein@databricks.com>

Closes #1595 from falaki/objectStreamReset and squashes the following commits:

650a935 [Hossein] Updated documentation
1aa0df8 [Hossein] Reduce default value of spark.serializer.objectStreamReset
parent cf3e9fd8
No related branches found
No related tags found
No related merge requests found
......@@ -108,7 +108,7 @@ private[spark] class JavaSerializerInstance(counterReset: Int) extends Serialize
*/
@DeveloperApi
class JavaSerializer(conf: SparkConf) extends Serializer with Externalizable {
private var counterReset = conf.getInt("spark.serializer.objectStreamReset", 10000)
private var counterReset = conf.getInt("spark.serializer.objectStreamReset", 100)
def newInstance(): SerializerInstance = new JavaSerializerInstance(counterReset)
......
......@@ -380,13 +380,13 @@ Apart from these, the following properties are also available, and may be useful
</tr>
<tr>
<td><code>spark.serializer.objectStreamReset</code></td>
<td>10000</td>
<td>100</td>
<td>
When serializing using org.apache.spark.serializer.JavaSerializer, the serializer caches
objects to prevent writing redundant data, however that stops garbage collection of those
objects. By calling 'reset' you flush that info from the serializer, and allow old
objects to be collected. To turn off this periodic reset set it to a value &lt;= 0.
By default it will reset the serializer every 10,000 objects.
By default it will reset the serializer every 100 objects.
</td>
</tr>
<tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment