On dynamic memory allocation in sliding-window parallel patterns for streaming analytics

  • M. TorquatiEmail author
  • G. Mencagli
  • M. Drocco
  • M. Aldinucci
  • T. De Matteis
  • M. Danelutto


This work studies the issues related to dynamic memory management in Data Stream Processing, an emerging paradigm enabling the real-time processing of live data streams. In this paper, we consider two streaming parallel patterns and we discuss different implementation variants related to how dynamic memory is managed. The results show that the standard mechanisms provided by modern C++ are not entirely adequate for maximizing the performance. Instead, the combined use of an efficient general purpose memory allocator, a custom allocator optimized for the pattern considered and a custom variant of the C++ shared pointer mechanism, provides a performance improvement up to 16% on the best case.


Data Stream Processing Modern C++ Dynamic memory allocation Multicores Stream analytics Parallel patterns 



This work has been partially supported by the H2020 RePhrase (ICT-2014-1) project.


  1. 1.
    Aldinucci M, Danelutto M, Kilpatrick P, Meneghin M, Torquati M (2012) An efficient unbounded lock-free queue for multi-core systems. In: Proceedings of 18th International Euro-Par 2012 Parallel Processing, LNCS, vol 7484, pp 662–673. SpringerGoogle Scholar
  2. 2.
    Andrade H, Gedik B, Turaga D (2014) Fundamentals of stream processing. Cambridge University Press, Cambridge (Cambridge Books Online)CrossRefGoogle Scholar
  3. 3.
    Berger ED, McKinley KS, Blumofe RD, Wilson PR (2000) Hoard: a scalable memory allocator for multithreaded applications. SIGOPS Oper Syst Rev 34(5):117–128CrossRefGoogle Scholar
  4. 4.
    Bonwick J (1994) The slab allocator: an object-caching kernel memory allocator. In: USENIX Summer, Boston, vol 16Google Scholar
  5. 5.
    Danelutto M, Matteis TD, Mencagli G, Torquati M (2015) Parallelizing high-frequency trading applications by using c++11 attributes. In: 2015 IEEE Trustcom/BigDataSE/ISPA, vol 3, pp 140–147Google Scholar
  6. 6.
    Danelutto M, Mencagli G, Torquati M (2016) Efficient dynamic memory allocation in data stream processing programs. In: 2016 IEEE UIC/ATC/ScalCom/CBDCom/IoP/SmartWorld, pp 1181–1188Google Scholar
  7. 7.
    Danelutto M, Torquati M (2015) Structured parallel programming with “core” fastflow. In: Zsók V, Horváth Z, Csató L (eds.) Central European Functional Programming School, LNCS, vol 8606, pp 29–75. SpringerGoogle Scholar
  8. 8.
    De Matteis T, Mencagli G (2016) Keep calm and react with foresight: strategies for low-latency and energy-efficient elastic data stream processing. In: Proceedings of the 21th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2016. ACM, New YorkGoogle Scholar
  9. 9.
    De Matteis T, Mencagli G (2016) Parallel patterns for window-based stateful operators on data streams: an algorithmic skeleton approach. Int J Parallel Program 45(2):382–401CrossRefGoogle Scholar
  10. 10.
    del Rio Astorga D, Dolz MF, Sanchez LM, Blas JG, García JD (2016) A C++ generic parallel pattern interface for stream processing, pp 74–87. Springer International Publishing, Cham. doi: 10.1007/978-3-319-49583-5
  11. 11.
    Evans J (2011) Scalable memory allocation using jemalloc. Facebook notesGoogle Scholar
  12. 12.
    Falt Z, Kruliš M, Bednárek D, Yaghob J, Zavoral F (2015) Towards efficient locality aware parallel data stream processing. J Univ Comput Sci 21(6):816–841MathSciNetGoogle Scholar
  13. 13.
    Michael MM (2004) Scalable lock-free dynamic memory allocation. SIGPLAN Not 39(6):35–46CrossRefGoogle Scholar
  14. 14.
    Perera S, Suhothayan S (2015) Solution patterns for realtime streaming analytics. In: Proceedings of the 9th ACM International Conference on Distributed Event-based Systems, DEBS ’15, pp 247–255. ACM, New York. doi: 10.1145/2675743.2774214
  15. 15.
    Reinders J (2007) Intel threading building blocks, 1st edn. O’Reilly & Associates Inc, SebastopolGoogle Scholar
  16. 16.
    Risco-Martín JL, Colmenar JM, Hidalgo JI, Lanchares J, Díaz J (2014) A methodology to automatically optimize dynamic memory managers applying grammatical evolution. J Syst Softw 91:109–123CrossRefGoogle Scholar
  17. 17.
    Sattler KU, Beier F (2013) Towards elastic stream processing: patterns and infrastructure. In: Cormode G, Yi K, Deligiannakis A, Garofalakis MN (eds.) BD3@VLDB, CEUR Workshop Proceedings, vol 1018, pp 49–54.
  18. 18.
    Wu J, Tan KL, Zhou Y (2007) Window-oblivious join: a data-driven memory management scheme for stream join. In: 19th International Conference on Scientific and Statistical Database Management (SSDBM 2007), pp 21. doi: 10.1109/SSDBM.2007.43

Copyright information

© Springer Science+Business Media, LLC 2017

Authors and Affiliations

  1. 1.Department of Computer ScienceUniversity of PisaPisaItaly
  2. 2.Department of Computer ScienceUniversity of TurinTurinItaly

Personalised recommendations