Memento mori: dynamic allocation-site-based optimizations
- 14 June 2015
- conference paper
- conference paper
- Published by Association for Computing Machinery (ACM)
Abstract
Languages 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 machines to close the performance gap between typed and untyped languages. While all languages can benefit from efficient automatic memory management, languages like JavaScript present extra thrill with innocent-looking but difficult features like dynamically-sized arrays, deletable properties, and prototypes. Optimizing such languages requires complex dynamic techniques with more radical object layout strategies such as dynamically evolving representations for arrays. This paper presents a general approach for gathering temporal allocation site feedback that tackles both the general problem of object lifetime estimation and improves optimization of these problematic language features. We introduce a new implementation technique where allocation mementos processed by the garbage collector and runtime system efficiently tie objects back to allocation sites in the program and dynamically estimate object lifetime, representation, and size to inform three optimizations: pretenuring, pretransitioning, and presizing. Unlike previous work on pretenuring, our system utilizes allocation mementos to achieve fully dynamic allocation-site-based pretenuring in a production system. We implement all of our techniques in V8, a high performance virtual machine for JavaScript, and demonstrate solid performance improvements across a range of benchmarks.Keywords
This publication has 29 references indexed in Scilit:
- Z-raysACM SIGPLAN Notices, 2010
- Generating object lifetime traces with MerlinACM Transactions on Programming Languages and Systems, 2006
- Heap compression for memory-constrained Java environmentsACM SIGPLAN Notices, 2003
- Controlling fragmentation and space consumption in the metronome, a real-time garbage collector for JavaACM SIGPLAN Notices, 2003
- Pretenuring for JavaACM SIGPLAN Notices, 2001
- Segregating heap objects by reference behavior and lifetimeACM SIGPLAN Notices, 1998
- Generational stack collection and profile-driven pretenuringACM SIGPLAN Notices, 1998
- An adaptive tenuring policy for generation scavengersACM Transactions on Programming Languages and Systems, 1992
- Simple generational garbage collection and fast allocationSoftware: Practice and Experience, 1989
- Self: The power of simplicityACM SIGPLAN Notices, 1987