Optimal Heap Limits for Reducing Browser Memory Use

by   Marisa Kirisame, et al.

Garbage collected language runtimes must 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-working-memory rules of thumb. But because it's a trade-off, it's not clear what heap limit rule is best or how even to compare them. We address this problem with a new framework where heap limits are set for multiple heaps at once. In this framework, standard heap limit rules are non-compositional: multiple heaps using the same heap limit rule allocate memory in non-Pareto-optimal ways. We use our framework to derive a compositional "square-root" heap limit rule, which achieves minimizes total memory usage for any amount of total garbage collection time. Paradoxically, the square-root heap limit rule achieves coordination without communication: it allocates memory optimally across multiple heaps without requiring any communication between 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.99 of memory usage. On memory-intensive benchmarks, reductions of up to 6.55 garbage collection time are possible with no change in total memory usage.


page 13

page 15


Incomplete sets in P for logspace-reduction

In this article, we investigate the behaviour of TMs with time limit and...

Efficient RLHF: Reducing the Memory Usage of PPO

Reinforcement Learning with Human Feedback (RLHF) has revolutionized lan...

Building Rule Hierarchies for Efficient Logical Rule Learning from Knowledge Graphs

Many systems have been developed in recent years to mine logical rules f...

Shared-Memory Branch-and-Reduce for Multiterminal Cuts

We introduce the fastest known exact algorithm for the multiterminal cut...

Comparing Apples and Oranges: Two Examples of the Limits of Statistical Inference, With an Application to Google Advertising Markets

We show how the classic Cramer-Rao bound limits how accurately one can s...

Stability of defection, optimisation of strategies and the limits of memory in the Prisoner's Dilemma

Memory-one strategies are a set of Iterated Prisoner's Dilemma strategie...

Cutting Down Training Memory by Re-fowarding

Deep Neutral Networks(DNN) require huge GPU memory when training on mode...

Please sign up or login with your details

Forgot password? Click here to reset