Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear expect rule program cache when heap is almost exhausted #1024

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Jun 28, 2024

There is some controversy over whether this is completely reliable, but it seems to work well in my tests, with and without --max-old-space-size passed in.

I initially tried to just stop adding new programs to the cache at a certain threshold, but somehow memory still shoots up after no more programs are being created at a modest heap usage. So we do this check and purge even if the current getProgram call didn’t eat up more memory itself.

This fixes the recent openui5 CI OOM.

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changeset but otherwise seems good.

packages/eslint-plugin/src/rules/expect.ts Outdated Show resolved Hide resolved
@jakebailey
Copy link
Member

Though, hopefully it won't get into a situation where GC hasn't run and the next run throws things away again. I'd say to call process.gc but that won't be available without --expose-gc...

@andrewbranch andrewbranch merged commit 3fec9fe into main Jun 28, 2024
7 checks passed
@andrewbranch andrewbranch deleted the clear-program-cache-on-high-memory branch June 28, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants