Optimal heap limits for reducing browser memory use
Marisa Kirisame, Pranav Shenoy, Pavel Panchekha
Abstract
Garbage-collected language runtimes carefully tune heap limits to reduce garbage collection time and memory usage. However, there's a trade-off: a lower heap limit reduces memory use but increases garbage collection time. Classic methods for setting heap limits include manually tuned heap limits and multiple-of-live-size rules of thumb, but it is not clear when one rule is better than another or how to compare them.
We address this problem with a new framework where heap limits are set for multiple heaps at once. Our key insight is that every heap limit rule induces a particular allocation of memory across multiple processes, and this allocation can be sub-optimal. We use our framework to derive an optimal "square-root" heap limit rule, which minimizes total memory usage for any amount of total garbage collection time. Paradoxically, the square-root heap limit rule achieves this coordination without communication: it allocates memory optimally across multiple heaps without requiring any communication between those heaps.
To demonstrate that this heap limit rule is effective, we prototype it for V8, the JavaScript runtime used in Google Chrome, Microsoft Edge, and other browsers, as well as in server-side frameworks like node.js and Deno. On real-world web pages, our prototype achieves reductions of approximately 16.0% of memory usage while keeping garbage collection time constant. On memory-intensive benchmarks, reductions of up to 30.0% of garbage collection time are possible with no change in total memory usage.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext a23c8717-c379-4f9e-b785-08f7cbfc264eBuilds on3
- Dynamic Tensor RematerializationMarisa Kirisame, Steven Lyubomirsky, Altan Haan, Jennifer Brennan et al.ICLR 2021 · 115 citations
- Spook.js: Attacking Chrome Strict Site Isolation via Speculative ExecutionAyush Agarwal, Sioli O'Connell, Jason Kim, Shaked Yehezkel et al.S&P 2022 · 32 citations
- M3: end-to-end memory management in elastic system software stacksDavid Lion, Adrian Chiu, Ding YuanEuroSys 2021 · 3 citations
Related papers
- Evaluating Garbage Collection Performance Across Managed Language RuntimesYicheng Wang, Wensheng Dou, Yu Liang, Yi Wang et al.ICSE 2025 · 1 citation
- Pathological Cases for a Class of Reachability-Based Garbage CollectorsMatthew SotoudehOOPSLA 2025 · 2 citations
- Uncovering Hidden Memory Costs for Garbage CollectionSudhanshu Agarwal, Saugata GhoseOOPSLA 2026
- Shaving the Peaks: Taming Tail Latency for Managed Workloads via Disaggregated Garbage CollectionHongtao Lyu, Yuhan Li, Mingyu WuOSDI 2026
- Investigating Managed Language Runtime Performance: Why JavaScript and Python are 8x and 29x slower than C++, yet Java and Go can be Faster?David Lion, Adrian Chiu, Michael Stumm, Ding YuanUSENIX ATC 2022 · 31 citations
