DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #178
Which of the following describes why garbage collection in Spark is important?
The correct answer is C. Spark jobs will fail or run slowly if memory is not available for new objects to be created. Garbage collection (GC) in the JVM (which underpins Spark) reclaims heap memory occupied by objects that are no longer referenced. If GC does not run efficiently or frequently enough, memory fills up and the JVM cannot allocate space for new objects - causing jobs to slow down…
Question
Which of the following describes why garbage collection in Spark is important?
Options
- ALogical results will be incorrect if inaccurate data is not collected and removed from the Spark job.
- BSpark jobs will fail or run slowly if inaccurate data is not collected and removed from the Spark job.
- CSpark jobs will fail or run slowly if memory is not available for new objects to be created.
- DSpark jobs will produce inaccurate results if there are too many different transformations called
- ESpark jobs will produce inaccurate results if memory is not available for new tasks to run and
How the community answered
(49 responses)- A8% (4)
- B2% (1)
- C86% (42)
- D4% (2)
Explanation
Garbage collection (GC) in the JVM (which underpins Spark) reclaims heap memory occupied by objects that are no longer referenced. If GC does not run efficiently or frequently enough, memory fills up and the JVM cannot allocate space for new objects - causing jobs to slow down due to GC pauses or fail with OutOfMemoryError. GC has no effect on the logical correctness of results (ruling out choices A, D, and E), and it is about memory availability for new objects, not task scheduling.
Topics
Community Discussion
No community discussion yet for this question.