Effect of garbage collection in iterative algorithms on Spark: an experimental analysis

  • Minseo Kang
  • Jae-Gil LeeEmail author


Spark is one of the most widely used systems for the distributed processing of big data. Its performance bottlenecks are mainly due to the network I/O, disk I/O, and garbage collection. Previous studies quantitatively analyzed the performance impact of these bottlenecks but did not focus on iterative algorithms. In an iterative algorithm, garbage collection has more performance impact than other workloads because the algorithm repeatedly loads and deletes data in the main memory through multiple iterations. Spark provides three caching mechanisms which are “disk cache,” “memory cache,” and “no cache” to keep the unchanged data across iterations. In this paper, we provide an in-depth experimental analysis of the effect of garbage collection on the overall performance depending on the caching mechanisms of Spark with various combinations of algorithms and datasets. The experimental results show that garbage collection accounts for 16–47% of the total elapsed time of running iterative algorithms on Spark and that the memory cache is no less advantageous in terms of garbage collection than the disk cache. We expect the results of this paper to serve as a guide for the tuning of garbage collection in the running of iterative algorithms on Spark.


Spark Garbage collection Iterative algorithms Distributed processing Storage level 



This research, “Geospatial Big Data Management, Analysis and Service Platform Technology Development,” was supported by the MOLIT (The Ministry of Land, Infrastructure and Transport), Korea, under the national spatial information research program supervised by the KAIA (Korea Agency for Infrastructure Technology Advancement) (19NSIP-B081011-06).


  1. 1.
    Apache. Apache Spark: Accessed 24 Dec 2019
  2. 2.
    Kang M, Lee J (2016). A comparative analysis of iterative MapReduce systems. In: Proceedings of the 6th International Conference on Emerging Databases: Technologies, Applications, and Theory (EDB), pp 61–64Google Scholar
  3. 3.
    Kang M, Lee J (2017) An experimental analysis of limitations of MapReduce for iterative algorithms on Spark. Clust Comput 20:2604–3593Google Scholar
  4. 4.
    Lee H, Kang M, Youn SB, Lee JG, Kwon, Y (2016) An experimental comparison of iterative MapReduce frameworks. In: Proceedings of the 25th ACM International on Conference on Information and Knowledge Management, pp 2089–2094Google Scholar
  5. 5.
    Ousterhout K, Rasti R, Ratnasamy S, Shenker S, Chun BG (2015) Making sense of performance in data analytics frameworks. Natl Spat Data Infrastruct 15:293–307Google Scholar
  6. 6.
    Oracle. Java garbage collection basics: Accessed 24 Dec 2019
  7. 7.
    Bu Y, Howe B, Balazinska M, Ernst MD (2010) HaLoop: efficient iterative data processing on large clusters. Proc VLDB Endow 3(1–2):285–296CrossRefGoogle Scholar
  8. 8.
    Zhang Y, Gao Q, Gao L, Wang C (2012) iMapreduce: a distributed computing framework for iterative computation. J Grid Comput 10(1):47–68CrossRefGoogle Scholar
  9. 9.
    Ekanayake J, Li H, Zhang B, Gunarathne T, Bae SH, Qiu J, Fox G (2010) Twister: a runtime for iterative MapReduce. In: Proceedings of the 19th ACM International Symposium on High Performance Distributed Computing, pp 810–818Google Scholar
  10. 10.
    Karau H, Warren R (2016) High performance Spark: best practices for scaling and optimizing Apache Spark. O’Reilly Media Inc., SebastopolGoogle Scholar
  11. 11.
    Karau H, Konwinski A, Wendell P, Zaharia M (2015) Learning Spark. O’Reilly Media Inc., SebastopolGoogle Scholar
  12. 12.
    Apache. Apache Spark garbage collection tuning. Accessed 24 Dec 2019
  13. 13.
    Xu L, Guo T, Duo W, Wang W, Wei J (2019) An experimental evaluation of garbage collectors on big data applications. Proc VLDB Endow 12(5):570–583CrossRefGoogle Scholar
  14. 14.
    Xu L, Li M, Zhang L, Butt AR, Wang Y, Hu ZZ (2016) MEMTUNE: dynamic memory management for in-memory data analytic platforms. In: Proceedings of IEEE International Parallel and Distributed Processing Symposium (IPDPS), pp 383–392Google Scholar
  15. 15.
    Lu L, Shi X, Zhou Y, Zhang X, Jin H, Pei C, He L, Geng Y (2016) Lifetime-based memory management for distributed data processing systems. Proc VLDB Endow 9(12):936–947CrossRefGoogle Scholar
  16. 16.
    Bu Y, Borkar VR, Xu GH, Carey MJ (2013). A bloat-aware design for big data applications. In: Proceedings of the International Symposium on Memory Management (ISMM), pp 119–130Google Scholar
  17. 17.
    Chu C, Kim SK, Lin YA, Yu Y, Bradski G, Ng AY, Olukotun K (2007) Map-reduce for machine learning on multicore. Adv Neural Inf Process Syst 6:281–288Google Scholar
  18. 18.
    The Lemur Project. The ClueWeb09 collection. Accessed 24 Dec 2019
  19. 19.
    Leskovec J, Krevl A SNAP datasets. Accessed 24 Dec 2019
  20. 20.
    Kwon Y, Nunley D, Gardner JP, Balazinska M, Howe B, Loebman S (2010) Scalable clustering algorithm for N-body simulations in a shared-nothing cluster. Sci Stat Database Manag 6187:132–150Google Scholar
  21. 21.
    Apache. Apache Spark web interfaces. Accessed 24 Dec 2019

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2020

Authors and Affiliations

  1. 1.Graduate School of Knowledge Service EngineeringKAISTDaejeonKorea

Personalised recommendations