How can we optimize and minimize the memory when work with scala use case

0 votes
When we calculate some use case with million of list in a collection, what can we do so that the memory allocation will be less but the output will be same? Can anyone explain?
Jul 5, 2019 in Apache Spark by nilam
826 views

1 answer to this question.

0 votes

Hi,

There is a term in Scala that is Lazy evaluation which is used for the spark to get rid of huge memory allocation. You can see the example below to see no memory allocation:

scala> lazy val x = (1 to 1000) .toList


You will get the same output but there will be no memory allocation to the var x.

answered Jul 5, 2019 by Gitika
• 65,890 points

Related Questions In Apache Spark

–1 vote
0 answers
0 votes
1 answer

How can I minimize data transfers when working with Spark?

Minimizing data transfers and avoiding shuffling helps ...READ MORE

answered Sep 19, 2018 in Apache Spark by zombie
• 3,790 points
3,041 views
0 votes
1 answer

How can we use spark shell for scala without cluster?

You can run the Spark shell for ...READ MORE

answered Apr 28, 2019 in Apache Spark by Giri
638 views
0 votes
0 answers

When we create an RDD, does it bring the data and load it into the memory?

Can anyone suggest when we create an ...READ MORE

Jul 3, 2019 in Apache Spark by monalisa

recategorized Jul 4, 2019 by Gitika 1,239 views
+1 vote
2 answers
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,921 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,449 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,279 views
0 votes
1 answer

When we create an RDD, does it bring the data and load it into the memory?

Hi, No. An RDD is made up of ...READ MORE

answered Jul 5, 2019 in Apache Spark by Gitika
• 65,890 points
765 views
0 votes
1 answer

How to use Scala anonymous functions and why do we use it?

Hi, Anonymous functions in Scala is the lightweight ...READ MORE

answered Jul 26, 2019 in Apache Spark by Gitika
• 65,890 points
780 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP