[ 
https://issues.apache.org/jira/browse/SPARK-17306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15449512#comment-15449512
 ] 

Tim Hunter commented on SPARK-17306:
------------------------------------

[~srowen] yes I had a discussion yesterday with [~clockfly]. The issue is 
performance, not correctness, by the way. The fix is to add a call to the 
compression: the compression threshold should be
used in insert() after inserting the head buffer at this line:

https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/QuantileSummaries.scala#L66

Unless someone else wants to step in, I will be happy to fix this issue.

> Memory leak in QuantileSummaries
> --------------------------------
>
>                 Key: SPARK-17306
>                 URL: https://issues.apache.org/jira/browse/SPARK-17306
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Sean Zhong
>
> compressThreshold was not referenced anywhere
> {code}
> class QuantileSummaries(
>     val compressThreshold: Int,
>     val relativeError: Double,
>     val sampled: ArrayBuffer[Stats] = ArrayBuffer.empty,
>     private[stat] var count: Long = 0L,
>     val headSampled: ArrayBuffer[Double] = ArrayBuffer.empty) extends 
> Serializable
> {code}
> And, it causes memory leak, QuantileSummaries takes unbounded memory
> {code}
> val summary = new QuantileSummaries(10000, relativeError = 0.001)
> // Results in creating an array of size 100000000 !!! 
> (1 to 100000000).foreach(summary.insert(_))
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to