You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by rsearle <eg...@verizon.net> on 2015/05/07 04:48:56 UTC
Spark updateStateByKey fails with class leak when using case
classes - resend
<<Apologies for the repeat. The first was rejected by the submission
process>>
I created a simple Spark streaming program using updateStateByKey.
The domain is represented by case classes for clarity, type safety, etc.
Spark job continuously loads new classes, which are removed by GC to
maintain
a relatively constant level of active classes instances. The total memory
footprint grows and the throughput slows, until the job fails. The failure
is generally triggered when
the processing cannot no longer keep up with the rate limited input.
The offending classes are of the form
"sun.reflect.GeneratedSerializationConstructorAccessor125".
This failure does not occur if the job is rewritten to use only Scala
classes: tuples and primitives.
The following github project contains the test code and more details
https://github.com/searler/SparkStreamingLeak
<https://github.com/searler/SparkStreamingLeak>
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-updateStateByKey-fails-with-class-leak-when-using-case-classes-resend-tp22793.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org
Re: Spark updateStateByKey fails with class leak when using case
classes - resend
Posted by Tathagata Das <ta...@gmail.com>.
Interesting, only in local[*]! In the github you pointed to, what is the
main that you were running.
TD
On Mon, May 25, 2015 at 9:23 AM, rsearle <eg...@verizon.net> wrote:
> Further experimentation indicates these problems only occur when master is
> local[*].
>
> There are no issues if a standalone cluster is used.
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/Spark-updateStateByKey-fails-with-class-leak-when-using-case-classes-resend-tp22793p23020.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>
>
Re: Spark updateStateByKey fails with class leak when using case
classes - resend
Posted by rsearle <eg...@verizon.net>.
1.4.0 resolves the problem.
The total classes loaded for an updateStateByKey over Int and String types
does not increase.
The total classes loaded for an updateStateByKey over case classes does
increase over time, but
the processing remains stable. Both memory consumption and CPU load remain
bounded.
The processing time graph for the case class test is much noisier, with
repeated spikes to 2.5x over the base line.
This is quite clear in the histogram, with two distinct clusters.
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-updateStateByKey-fails-with-class-leak-when-using-case-classes-resend-tp22793p23364.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org
Re: Spark updateStateByKey fails with class leak when using case
classes - resend
Posted by rsearle <eg...@verizon.net>.
Further experimentation indicates these problems only occur when master is
local[*].
There are no issues if a standalone cluster is used.
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-updateStateByKey-fails-with-class-leak-when-using-case-classes-resend-tp22793p23020.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org