Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

Allocation folding based on dominance

Published: 12 June 2014 Publication History

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.

References

[1]
C. Authors. Textwriter. http://www.chrome.org.
[2]
J. M. Barth. Shifting garbage collection overhead to compile time. Communications of the ACM, 20(7):513--518, July 1977.
[3]
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.
[4]
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.
[5]
J. Dolby and A. Chien. An automatic object inlining optimization and its evaluation. SIGPLAN Notices, 35(5):345--357, May 2000.
[6]
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.
[7]
Google Inc. Octane. https://developers.google.com/octane, 2013.
[8]
Google Inc. V8. https://code.google.com/p/v8, 2013.
[9]
Google Inc. V8 design. https://code.google.com/p/v8/design, 2013.
[10]
I. Gouy. Nbody. http://shootout.alioth.debian.org.
[11]
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.
[12]
D. McNamee. Soft3d, 2008.
[13]
Mozilla. Kraken. https://krakenbenchmark.mozilla.org, 2013.
[14]
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.
[15]
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.
[16]
A. Ritter. JPEGEncoder. https://github.com/owencm/javascript-jpegencoder, 2009.
[17]
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.
[18]
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.
[19]
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.
[20]
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.
[21]
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.
[22]
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.
[23]
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.

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 49, Issue 11
ISMM '14
November 2014
121 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/2775049
  • Editor:
  • Andy Gill
Issue’s Table of Contents
  • cover image ACM Conferences
    ISMM '14: Proceedings of the 2014 international symposium on Memory management
    June 2014
    136 pages
    ISBN:9781450329217
    DOI:10.1145/2602988
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 June 2014
Published in SIGPLAN Volume 49, Issue 11

Check for updates

Author Tags

  1. dynamic optimization
  2. garbage collection
  3. javascript
  4. memory managment
  5. write barriers

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)5
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media