Flow: Flow consumes 30GB+ of memory when left running

Created on 21 Jul 2018  路  2Comments  路  Source: facebook/flow

I'm running Flow via the Flow Language Support extension for VSCode, and as soon as I enable the extension 10 flow processes spin up and start consuming memory 鈥斅爑sually one process growing to about 15-20GB, and then a second process starts growing, until my computer becomes unusable and I am forced to kill all of the processes (at which point they respawn and the cycle repeats).

I am on macOS 10.14 beta 4 (18A336e) and have reproduced this with both the official Flow Language Support extension for VSCode as well as the JavaScript Enhancements plugin for Sublime. I will check if this is reproducible in my project on 10.13 when I can, but for now it's not clear to me if this is an issue with just the beta OS or with how flow interacts with my project in general.

nontermination / perf

Most helpful comment

Thanks for the tip, you were right 鈥斅爄t was a few very large JSON files I had sitting around that I had to mark as ignored. Might make sense for flow to at least emit some kind of warning when trying to parse files larger than some threshold so this is easier to track down.

All 2 comments

I sometimes run into this problem when flow tries to typecheck files which are not meant for it (e.g., very large JSONs which are lying in the same folder). You can check whether this is also the cause for you by following the following checks:

  • create a new empty project (only flow init) and ensure that flow terminates without memory issues (if the issue persists, something else is wrong)
  • switch back to your project and blacklist all files via .flowconfig
  • run flow
  • undo the blacklisting step-by-step to see which files are responsible for the high memory consumption

Of course, this shouldn't happen, but maybe these steps helps you.

Thanks for the tip, you were right 鈥斅爄t was a few very large JSON files I had sitting around that I had to mark as ignored. Might make sense for flow to at least emit some kind of warning when trying to parse files larger than some threshold so this is easier to track down.

Was this page helpful?
0 / 5 - 0 ratings