Affiliation:
1. Tufts University, USA
2. University of Massachusetts at Amherst, USA
Abstract
Programmers routinely trade space for time to increase performance, often in the form of caching or memoization. In managed languages like Java or JavaScript, however, this space-time tradeoff is complex. Using more space translates into higher garbage collection costs, especially at the limit of available memory. Existing runtime systems provide limited support for space-sensitive algorithms, forcing programmers into difficult and often brittle choices about provisioning.
This paper presents
prioritized garbage collection
, a cooperative programming language and runtime solution to this problem. Prioritized GC provides an interface similar to soft references, called
priority references
, which identify objects that the collector can reclaim eagerly if necessary. The key difference is an API for defining the policy that governs when priority references are cleared and in what order. Application code specifies a priority value for each reference and a target memory bound. The collector reclaims references, lowest priority first, until the total memory footprint of the cache fits within the bound. We use this API to implement a space-aware least-recently-used (LRU) cache, called a
Sache
, that is a drop-in replacement for existing caches, such as Google's Guava library. The garbage collector automatically grows and shrinks the Sache in response to available memory and workload with minimal provisioning information from the programmer. Using a Sache, it is almost impossible for an application to experience a memory leak, memory pressure, or an out-of-memory crash caused by software caching.
Funder
National Science Foundation
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference20 articles.
1. GC assertions
2. Workload analysis of a large-scale key-value store
3. Jonathan Bellis. Jamm. https://github.com/jbellis/jamm. Jonathan Bellis. Jamm. https://github.com/jbellis/jamm.
4. Myths and realities
Cited by
2 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Towards Increased Datacenter Efficiency with Soft Memory;Proceedings of the 19th Workshop on Hot Topics in Operating Systems;2023-06-22
2. Optimal heap limits for reducing browser memory use;Proceedings of the ACM on Programming Languages;2022-10-31