ABSTRACT
Memory management system performance is of increasing importance in today's managed languages. Two lingering sources of overhead are the direct costs of memory allocations and write barriers. This paper introduces it allocation folding, an optimization technique where the virtual machine automatically folds multiple memory allocation operations in optimized code together into a single, larger it allocation group. An allocation group comprises multiple objects and requires just a single bounds check in a bump-pointer style allocation, rather than a check for each individual object. More importantly, all objects allocated in a single allocation group are guaranteed to be contiguous after allocation and thus exist in the same generation, which makes it possible to statically remove write barriers for reference stores involving objects in the same allocation group. Unlike object inlining, object fusing, and object colocation, allocation folding requires no special connectivity or ownership relation between the objects in an allocation group. We present our analysis algorithm to determine when it is safe to fold allocations together and discuss our implementation in V8, an open-source, production JavaScript virtual machine. We present performance results for the Octane and Kraken benchmark suites and show that allocation folding is a strong performance improvement, even in the presence of some heap fragmentation. Additionally, we use four hand-selected benchmarks JPEGEncoder, NBody, Soft3D, and Textwriter where allocation folding has a large impact.
- C. Authors. Textwriter. http://www.chrome.org.Google Scholar
- J. M. Barth. Shifting garbage collection overhead to compile time. Communications of the ACM, 20(7):513--518, July 1977. Google ScholarDigital Library
- S. M. Blackburn and A. L. Hosking. Barriers: friend or foe? In Proceedingsof the International Symposium on Memory Management, ISMM '04, pages 143--151, New York, NY, USA, 2004. ACM. Google ScholarDigital Library
- J. Dolby. Automatic inline allocation of objects. In Proceedings of the Conference on Programming Language Design and Implementation, PLDI '97, pages 7--17, New York, NY, USA, 1997. ACM. Google ScholarDigital Library
- J. Dolby and A. Chien. An automatic object inlining optimization and its evaluation. SIGPLAN Notices, 35(5):345--357, May 2000. Google ScholarDigital Library
- J. Dolby and A. A. Chien. An evaluation of automatic object inline allocation techniques. In Proceeding of the Conference on Object- Oriented Programming Systems, Languages, and Applications, OOPSLA '98, pages 1--20. ACM Press, 1998. Google ScholarDigital Library
- Google Inc. Octane. https://developers.google.com/octane, 2013.Google Scholar
- Google Inc. V8. https://code.google.com/p/v8, 2013.Google Scholar
- Google Inc. V8 design. https://code.google.com/p/v8/design, 2013.Google Scholar
- I. Gouy. Nbody. http://shootout.alioth.debian.org.Google Scholar
- S. Z. Guyer and K. S. McKinley. Finding your cronies: static analysis for dynamic object colocation. In Proceedings of the Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA '04, pages 237--250, New York, NY, USA, 2004. ACM. Google ScholarDigital Library
- D. McNamee. Soft3d, 2008.Google Scholar
- Mozilla. Kraken. https://krakenbenchmark.mozilla.org, 2013.Google Scholar
- V. K. Nandivada and D. Detlefs. Compile-time concurrent marking write barrier removal. In Proceedings of the International Symposium on Code Generation and Optimization, CGO '05, pages 37--48,Washington, DC, USA, 2005. IEEE Computer Society. Google ScholarDigital Library
- F. Pizlo, E. Petrank, and B. Steensgaard. Path specialization: reducing phased execution overheads. In Proceedings of the International Symposium on Memory Management, ISMM '08, pages 81--90, NewYork, NY, USA, 2008. ACM. Google ScholarDigital Library
- A. Ritter. JPEGEncoder. https://github.com/owencm/javascript-jpegencoder, 2009.Google Scholar
- I. Rogers. Reducing and eliding read barriers for concurrent garbage collectors. In Proceedings of the Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems, ICOOOLPS '11, pages 5:1--5:5, New York, NY, USA, 2011. ACM. Google ScholarDigital Library
- M. T. Vechev and D. F. Bacon. Write barrier elision for concurrent garbage collectors. In Proceedings of the International Symposium on Memory Management, ISMM '04, pages 13--24, New York, NY, USA, 2004. ACM. Google ScholarDigital Library
- R. Veldema, J. H. Ceriel, F. H. Rutger, and E. Henri. Object combining: A new aggressive optimization for object intensive programs. In Proceedings of the Conference on Java Grande, JGI '02, pages 165--174, New York, NY, USA, 2002. ACM. Google ScholarDigital Library
- C. Wimmer and M. Franz. Linear scan register allocation on SSA form. In Proceedings of the International Symposium on Code Generation and Optimization, CGO '10, pages 170--179, New York, NY, USA, 2010. ACM. Google ScholarDigital Library
- C.Wimmer and H.Mossenbosck. Automatic feedback-directed object fusing. ACM Transactions on Architecture and Code Optimization, 7(2):7:1--7:35, Oct. 2010. Google ScholarDigital Library
- X. Yang, S. M. Blackburn, D. Frampton, and A. L. Hosking. Barriers reconsidered, friendlier still! In Proceedings of the International Symposium on Memory Management, ISMM '12, pages 37--48, New York, NY, USA, 2012. ACM. Google ScholarDigital Library
- K. Zee and M. Rinard. Write barrier removal by static analysis. In Proceedings of the Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA '02, pages 191--210, New York, NY, USA, 2002. ACM. Google ScholarDigital Library
Index Terms
- Allocation folding based on dominance
Recommendations
Allocation folding based on dominance
ISMM '14Memory management system performance is of increasing importance in today's managed languages. Two lingering sources of overhead are the direct costs of memory allocations and write barriers. This paper introduces it allocation folding, an optimization ...
Memento mori: dynamic allocation-site-based optimizations
ISMM '15: Proceedings of the 2015 International Symposium on Memory ManagementLanguages that lack static typing are ubiquitous in the world of mobile and web applications. The rapid rise of larger applications like interactive web GUIs, games, and cryptography presents a new range of implementation challenges for modern virtual ...
Memento mori: dynamic allocation-site-based optimizations
ISMM '15Languages that lack static typing are ubiquitous in the world of mobile and web applications. The rapid rise of larger applications like interactive web GUIs, games, and cryptography presents a new range of implementation challenges for modern virtual ...
Comments