skip to main content
research-article

Dynamic page sharing optimization for the R language

Published:14 October 2014Publication History
Skip Abstract Section

Abstract

Dynamic languages such as R are increasingly used to process .large data sets. Here, the R interpreter induces a large memory overhead due to wasteful memory allocation policies. If an application's working set exceeds the available physical memory, the OS starts to swap, resulting in slowdowns of a several orders of magnitude. Thus, memory optimizations for R will be beneficial to many applications.

Existing R optimizations are mostly based on dynamic compilation or native libraries. Both methods are futile when the OS starts to page out memory. So far, only a few, data-type or application specific memory optimizations for R exist. To remedy this situation, we present a low-overhead page sharing approach for R that significantly reduces the interpreter's memory overhead. Concentrating on the most rewarding optimizations avoids the high runtime overhead of existing generic approaches for memory deduplication or compression. In addition, by applying knowledge of interpreter data structures and memory allocation patterns, our approach is not constrained to specific R applications and is transparent to the R interpreter.

Our page sharing optimization enables us to reduce the memory consumption by up to 53.5% with an average of 18.0% for a set of real-world R benchmarks with a runtime overhead of only 5.3% on average. In cases where page I/O can be avoided, significant speedups are achieved.

References

  1. Wang H., Wu P., Padua D., Optimizing R VM: Allocation Removal and Path Length Reduction via Interpreter-level Specialization. In Proceedings of the International Symposium on Code Generation and Optimization. Orlando, Florida. 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Neal R., pqR - a pretty quick version of R. University of Toronto, 2014. URL https://github.com/radfordneal/pqRGoogle ScholarGoogle Scholar
  3. Kalibera T., Maj P., Morandat F., Vitek, J., A Fast Abstract Syntax Tree Interpreter for R. In Proceedings of the 10th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments. Salt Lake City, Utah, USA. pp.89--102. 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bertram A., Renjin: JVM-based Interpreter for the R Language for Statistical Computing. 2014. URL http://www.renjin.orgGoogle ScholarGoogle Scholar
  5. Talbot J., DeVito Z., Hanrahan P., Riposte: a trace-driven Compiler and Parallel VM for Vector Code in R. In Proceedings of the 21st international conference on Parallel architectures and compilation techniques. Minneapolis, Minnesota, USA. pp.43--52. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Almasi G., Padua, D.A., MaJIC: A Matlab Just-In-Time Compiler. Languages and Compilers for Parallel Computing. Springer Berlin Heidelberg. pp.68--81. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bolz C.F., Cuni A., Fijalkowski M., Rigo, A., Tracing the meta-level: PyPy's tracing JIT compiler. In Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems. Genova, Italy. pp.18--25. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Morandat F., Hill B., Osvald, L., Vitek, J., Evaluating the Design of the R Language: Objects and Functions for Data Analysis. In Proceedings of the 26th European conference on Object-Oriented Programming. Beijing, China. pp. 104--131. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Kotthaus H., Korb I., Lang M., Bischl B., Rahnenführer J., Marwedel P., Runtime and Memory Consumption Analyses for Machine Learning R Programs. Journal of Statistical Computation and Simulation. 2014.Google ScholarGoogle Scholar
  10. Lang M., Kotthaus H, BenchR: Set of Benchmark of R. TU Dortmund University. 2014. URL https://github.com/allr/benchRGoogle ScholarGoogle Scholar
  11. R Core Team, R: A Language and Environment for Statistical Computing, R Foundation for Statistical Computing, Vienna, Austria, 2014. URL http://www.R-project.orgGoogle ScholarGoogle Scholar
  12. Valat S., Pérache M., Jalby W., Introducing Kernel-level Page Reuse for High Performance Computing. In Proceedings of the ACM SIGPLAN Workshop on Memory Systems Performance and Correctness. Seattle, Washington, pp.3:1--3:9. 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Chen L., Wei Z., Cui Z., Chen M., Pan H., Bao Y., CMD: Classification-based Memory Deduplication Through Page Access Characteristics. In Proceedings of the 10th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments. Salt Lake City, Utah, USA. pp.65--76. 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jula A., Rauchwerger L., Two Memory Allocators That Use Hints to Improve Locality. In Proceedings of the 2009 International Symposium on Memory Management. Dublin, Ireland. pp.109--118. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Arcangeli A., Eidus I., Wright C., Increasing memory density by using KSM. In Proceedings of the Ottawa Linux Symposium. Ottawa, Ontario, Canada. pp. 19--28. 2009.Google ScholarGoogle Scholar
  16. Wilson P., Kaplan S., Smaragdakis Y., The Case for Compressed Caching in Virtual Memory Systems. In Proceedings of USENIX ATC Monterey, California, USA. 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Beltran V., Torres J., Ayguade E., Improving disk bandwidth-bound applications through main memory compression. In Proceedings of the 2007 workshop on MEmory performance: DEaling with Applications, systems and architecture (MEDEA '07) ACM, New York, NY, USA, pp. 57--63. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Yang L., Dick R., Lekatsas H., Chakradhar S., High-performance operating system controlled online memory compression. In ACM Trans. Embed. Comput. Syst. 9, 4 ACM. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Pekhimenko G., Seshadri V., Kim Y., Xin H., Mutlu O., Gibbons P., Kozuch M., Mowry T., Linearly compressed pages: a low-complexity, low-latency main memory compression framework. In Proceedings of MICRO-46. ACM, New York, NY, USA, pp.172--184. 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Chihaia I., Gross T., An analytical model for software-only main memory compression. In Proceedings of the 3rd workshop on Memory performance issues (WMPI '04). ACM, New York, NY, USA, pp.107--113. 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Nakar D., Weiss S., Selective main memory compression by identifying program phase changes. In Proceedings of the 3rd workshop on Memory performance issues (WMPI '04). ACM, New York, NY, USA, pp.96--101. 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Benini L., Macii A., Macii E., Offline Data Profiling Techniques to Enhance Memory Compression in Embedded Systems. In Proceedings of the 12th International Workshop on Integrated Circuit Design, Power and Timing Modeling, Optimization and Simulation (PATMOS '02) Springer-Verlag, London, UK, pp.314--322. 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Lawlor O., In-memory data compression for sparse matrices. In Proceedings of the 3rd Workshop on Irregular Applications: Architectures and Algorithms (IA$^3$ '13). ACM, New York, NY, USA. 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Miller K., Franz F., Rittinghaus M., Hillenbrand M., Bellosa F., XLH: more effective memory deduplication scanners through cross-layer hints. In Proceedings of USENIX ATC'13. USENIX Association, Berkeley, CA, USA, 279--290. 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Sharma P., Kulkarni P., Singleton: system-wide page deduplication in virtual environments. In Proceedings of HPDC '12. ACM, New York, NY, USA, pp.15--26. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Deng Y., Song L., Huang X., Evaluating Memory Compression and Deduplication. In Proceedings of the IEEE NAS '13. IEEE Computer Society, Washington, DC, USA, pp.282--286. 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dynamic page sharing optimization for the R language

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 50, Issue 2
      DLS '14
      February 2015
      146 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2775052
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        DLS '14: Proceedings of the 10th ACM Symposium on Dynamic languages
        October 2014
        160 pages
        ISBN:9781450332118
        DOI:10.1145/2661088

      Copyright © 2014 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 14 October 2014

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!