Flow: Consider more conservative usage of resources

Created on 16 Nov 2016  路  5Comments  路  Source: facebook/flow

On my Early 2015 12" MacBook that has following specs

Hardware Overview:

  Model Name:   MacBook
  Model Identifier: MacBook8,1
  Processor Name:   Intel Core M
  Processor Speed:  1.3 GHz
  Number of Processors: 1
  Total Number of Cores:    2
  L2 Cache (per Core):  256 KB
  L3 Cache: 4 MB
  Memory:   8 GB
  Boot ROM Version: MB81.0164.B18
  SMC Version (system): 2.25f87
  Serial Number (system):   C02PL0PKGCN2
  Hardware UUID:    E4CD394E-7E1F-580E-9B79-9D6FB6643498

Flow often times tends to take over all of the CPU cycles making OS pretty much unresponsive.

While I like that flow does it's best to type check quickly, I would much rather prefer if it took longer but still made it possible for me to use my computer while waiting it to finish.

enhancement

Most helpful comment

When I launch my IDE with Flow integration (Webstorm), I see in 麓top麓 a 麓flow麓 process balloon to 26G virtual memory (9.7G resident) before it grinds down so horribly in swap hell that I can't even kill it.

Now, this may in part be because the IDE shouldn't try to run Flow against my whole workspace with many repos checked out, or maybe I shouldn't organise my files that way, but it'd still be nice if Flow refused to allocate more memory than I even have.

All 5 comments

P.S.: I usually see at least 6 flow processes running for a single project on this machine.

When I launch my IDE with Flow integration (Webstorm), I see in 麓top麓 a 麓flow麓 process balloon to 26G virtual memory (9.7G resident) before it grinds down so horribly in swap hell that I can't even kill it.

Now, this may in part be because the IDE shouldn't try to run Flow against my whole workspace with many repos checked out, or maybe I shouldn't organise my files that way, but it'd still be nice if Flow refused to allocate more memory than I even have.

I think this is a known issue. It seems that currently flow searches upward from the current directory for a .flowconfig file. If none is found, it will run flow on every .js file on your hard drive. It starts up multiple processes to support that. I always know when this happens because the fans in my MacBook Pro go crazy! I have to run killall flow to stop them.

This seems like a serious issue! Perhaps flow should require a .flowconfig file and just not run if none are found. This would be much better than the current situation.

This is still a serious issue and happens to me frequently. Ever time I edit a .js file in a project that is not using Flow, my editor which is configured to use Flow starts a Flow server. That sees there is no .flowconfig file in the directory. So it searches upward in the directory hierarchy looking for one. Eventually it reaches my home directory at which point it decides to run Flow on every .js on my hard drive.

The fix for this seems simple. If no .flowconfig file is found, I think it shouldn't run Flow on any .js files. Is there a reason this would be a bad fix?

any plans to improve this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vjpr picture vjpr  路  55Comments

jamesisaac picture jamesisaac  路  44Comments

jlongster picture jlongster  路  55Comments

sophiebits picture sophiebits  路  66Comments

blax picture blax  路  83Comments