betterer
betterer copied to clipboard
Fails with insufficient memory on large projects
Describe the bug
- On large projects
bettererfails out with a NodeJS heap out of memory exception. - I realize we can increase the node heap size but we're essentially maxing out a Github actions runner so we don't have much room left to run this in CI.
To Reproduce
Repo: https://github.com/adso023/Dummy-Repository
Command: yarn run betterer
// .betterer.ts
import { eslint } from '@betterer/eslint';
const eslintConfig = require('./.eslintrc.js');
export default {
'ts lint': eslint(eslintConfig.overrides[0].rules).include(['src/**/*.ts']),
};
Expected behavior
betterer should run correctly and it shouldn't error out due to insufficient memory
Screenshots

Versions (please complete the following information):
- OS: Windows 10 1809
- Betterer: 4.4.1
- Node: v14.17.0
Additional context It seems like this might be a similar issue to #1050, though we're running into memory issues rather than raw file count. It seems like from the comments in that ticket that betterer keeps each file open, is there any reason for this because it seems like closing files once parsed should solve both these issues.
Bump, also have this issue on my end