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

fix: avoid memory issues by doing better cleanup #4059

Merged
merged 5 commits into from
Jun 22, 2023
Merged

Conversation

WilcoFiers
Copy link
Contributor

I went over the entire codebase looking for places where we're keeping variables we should clean up after a run. Probably the biggest one was in querySelectorAllFilter, which was indicated as a problem in the issue. I found a few other places where info was stored in file scope where it shouldn't have been. Those have been fixed. There shouldn't be any of those left now.

The issue indicated the biggest problem with in FrameMessenger's channels. That's not something we can put into the cache though. FrameMessenger isn't necessarily tied to a run, so we can't clear channels after the run is closed. What I've tried to do instead is move things around a bit so we don't set listeners unnecessarily. I don't know if that solves the issue, but then I'm not sure if this is even an issue. Even if it persisted, I don't think channels should need to be all that big.

An alternative could be that we put a timeout directly into FrameMessenger. If no response happens after a predetermined time, the handler is deleted and an error is thrown. That's a complicated change, so if we can avoid that I think I'd prefer that. We'll see if this does enough to solve the issue.

Closes: #4045

@WilcoFiers WilcoFiers requested a review from a team as a code owner June 19, 2023 12:21
xhtml = isXHTML(document);
}
const xhtml = isXHTML(document);
console.log({ xhtml });
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
console.log({ xhtml });

@@ -1,3 +1,4 @@
import caches from '../base/cache';
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason you called this caches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heatwave 🌞

@@ -28,6 +29,23 @@ describe('region', function () {
assert.isTrue(checkEvaluate.apply(checkContext, checkArgs));
});

it('should return true when the region was removed from standards', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it('should return true when the region was removed from standards', () => {
it('should return true when a region role is added to standards', () => {

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.

Memory issue causing browser crash
2 participants