I have one job which fails if I enable KryoSerializer

I use spark 1.5.0 on emr-4.1.0

Settings:
spark.serializer                 org.apache.spark.serializer.KryoSerializer
spark.kryoserializer.buffer.max  1024m
spark.executor.memory            47924M
spark.yarn.executor.memoryOverhead 5324


The job works fine if I keep default spark.serializer BUT it fails if I use
KryoSerializer. I tried to increase kryoserializer buffer max to 1024m -
still having OOM error.


java.lang.OutOfMemoryError
    at
java.io.ByteArrayOutputStream.hugeCapacity(ByteArrayOutputStream.java:123)
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:117)
    at
java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
    at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
    at
org.xerial.snappy.SnappyOutputStream.dumpOutput(SnappyOutputStream.java:294)
    at
org.xerial.snappy.SnappyOutputStream.compressInput(SnappyOutputStream.java:306)
    at
org.xerial.snappy.SnappyOutputStream.rawWrite(SnappyOutputStream.java:245)
    at
org.xerial.snappy.SnappyOutputStream.write(SnappyOutputStream.java:107)
    at
org.apache.spark.io.SnappyOutputStreamWrapper.write(CompressionCodec.scala:189)
    at com.esotericsoftware.kryo.io.Output.flush(Output.java:155)
    at com.esotericsoftware.kryo.io.Output.require(Output.java:135)
    at com.esotericsoftware.kryo.io.Output.writeLong(Output.java:477)
    at com.esotericsoftware.kryo.io.Output.writeDouble(Output.java:596)
    at
com.esotericsoftware.kryo.serializers.DefaultSerializers$DoubleSerializer.write(DefaultSerializers.java:137)
    at
com.esotericsoftware.kryo.serializers.DefaultSerializers$DoubleSerializer.write(DefaultSerializers.java:131)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer$ObjectField.write(FieldSerializer.java:576)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:213)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer$ObjectField.write(FieldSerializer.java:564)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:213)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:568)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:21)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:19)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer$ObjectField.write(FieldSerializer.java:564)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:213)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:568)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:21)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:19)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer$ObjectField.write(FieldSerializer.java:564)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:213)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:568)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:21)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:19)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer$ObjectField.write(FieldSerializer.java:564)
    at
com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:213)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:568)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:21)
    at com.twitter.chill.SomeSerializer.write(SomeSerializer.scala:19)

Reply via email to