spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhan Zhang <>
Subject Re: Running Wordcount on large file stucks and throws OOM exception
Date Wed, 03 Sep 2014 23:43:36 GMT
In word count, you don’t need much driver memory, unless you do collect, but it is not recommended.

val file = sc.textFile("hdfs://")
val counts = file.flatMap(line => line.split(" ")).map(word => (word, 1)).reduceByKey(_
+ _)


Zhan Zhang

On Aug 26, 2014, at 12:35 AM, motte1988 <> wrote:

> Hello,
> it's me again.
> Now I've got an explanation for the behaviour. It seems that the driver
> memory is not large enough to hold the whole result set of saveAsTextFile
> In-Memory. And then OOM occures. I test it with a filter-step that removes
> KV-pairs with WordCount smaller 100,000. So now the job finished
> successfully.
> But is this the desired behaviour of Spark, that available driver memory
> limits the size of the result set?
> Or is my explanation wrong?
> --
> View this message in context:
> Sent from the Apache Spark User List mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

View raw message