Skip to content

Commit 576ee83

Browse files
committed
Allow objectStreamReset to be 0
1 parent 0374217 commit 576ee83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ private[spark] class JavaSerializationStream(out: OutputStream, counterReset: In
3535
/**
3636
* Calling reset to avoid memory leak:
3737
* http://stackoverflow.com/questions/1281549/memory-leak-traps-in-the-java-standard-api
38-
* But only call it every 10,000th time to avoid bloated serialization streams (when
38+
* But only call it every 100th time to avoid bloated serialization streams (when
3939
* the stream 'resets' object class descriptions have to be re-written)
4040
*/
4141
def writeObject[T: ClassTag](t: T): SerializationStream = {
4242
objOut.writeObject(t)
43-
if (counterReset > 0 && counter >= counterReset) {
43+
if (counterReset >= 0 && counter >= counterReset) {
4444
objOut.reset()
4545
counter = 0
4646
} else {

0 commit comments

Comments
 (0)