Affiliation:
1. Canisius College, Buffalo, NY
2. University of Massachusetts - Amherst, Amherst, MA
Abstract
Garbage collection yields numerous software engineering benefits, but its quantitative impact on performance remains elusive. One can compare the cost of
conservative
garbage collection to explicit memory management in C/C++ programs by linking in an appropriate collector. This kind of direct comparison is not possible for languages designed for garbage collection (e.g., Java), because programs in these languages naturally do not contain calls to free. Thus, the actual gap between the time and space performance of explicit memory management and
precise
, copying garbage collection remains unknown.We introduce a novel experimental methodology that lets us quantify the performance of precise garbage collection versus explicit memory management. Our system allows us to treat unaltered Java programs as if they used explicit memory management by relying on oracles to insert calls to free. These oracles are generated from profile information gathered in earlier application runs. By executing inside an architecturally-detailed simulator, this "oracular" memory manager eliminates the effects of consulting an oracle while measuring the costs of calling malloc and free. We evaluate two different oracles: a liveness-based oracle that aggressively frees objects immediately after their last use, and a reachability-based oracle that conservatively frees objects just after they are last reachable. These oracles span the range of possible placement of explicit deallocation calls.We compare explicit memory management to both copying and non-copying garbage collectors across a range of benchmarks using the oracular memory manager, and present real (non-simulated) runs that lend further validity to our results. These results quantify the time-space tradeoff of garbage collection: with five times as much memory, an Appel-style generational collector with a non-copying mature space matches the performance of reachability-based explicit memory management. With only three times as much memory, the collector runs on average 17% slower than explicit memory management. However, with only twice as much memory, garbage collection degrades performance by nearly 70%. When physical memory is scarce, paging causes garbage collection to run an order of magnitude slower than explicit memory management.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
24 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Heap Size Adjustment with CPU Control;Proceedings of the 20th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes;2023-10-19
2. Adapting Kubernetes controllers to the edge: on-demand control planes using Wasm and WASI;2022 IEEE 11th International Conference on Cloud Networking (CloudNet);2022-11-07
3. Optimal heap limits for reducing browser memory use;Proceedings of the ACM on Programming Languages;2022-10-31
4. Distilling the Real Cost of Production Garbage Collectors;2022 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS);2022-05
5. Machine-Learning Based Memory Prediction Model for Data Parallel Workloads in Apache Spark;Symmetry;2021-04-16