facebook / facebook/flow

Change default max heap size to 1/4 of physical memory

Open
#7,819 7 comments 0 reactions 1 assignee Claimed by @gabelevi View on GitHub
discussion nontermination / perf
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

## Proposal

Change the default max heap size from 25GiB to 1/4 of physical memory.

## Use case

25GiB is an abnormally large amount of memory: a [MacBook Pro](https://www.apple.com/macbook-pro/specs/) comes with 8GiB standard and can be upgrade to a maximum of 16GiB. Java defaults to 1/4 of physical memory and I can't think of a good argument against following Java's defaults.

### Subjective Reasoning

Anecdotally, this setting is causing performance issues and hurting adoption. I tried using Flow for a project and it immediately froze my machine. Memory issues are a common gripe, both in the bug tickets an in articles on switching from Flow to TS ([1](https://davidgomes.com/porting-30k-lines-of-code-from-flow-to-typescript/), [2](https://dev.to/wemake-services/from-flow-to-typescript-why-1k7m)). I'm guessing that the amount of physically available means that analyzing a large file will result in a frozen machine instead of a memory error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.