-
Notifications
You must be signed in to change notification settings - Fork 784
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
Conversation
lib/core/utils/get-selector.js
Outdated
xhtml = isXHTML(document); | ||
} | ||
const xhtml = isXHTML(document); | ||
console.log({ xhtml }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log({ xhtml }); |
@@ -1,3 +1,4 @@ | |||
import caches from '../base/cache'; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heatwave 🌞
test/checks/navigation/region.js
Outdated
@@ -28,6 +29,23 @@ describe('region', function () { | |||
assert.isTrue(checkEvaluate.apply(checkContext, checkArgs)); | |||
}); | |||
|
|||
it('should return true when the region was removed from standards', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('should return true when the region was removed from standards', () => { | |
it('should return true when a region role is added to standards', () => { |
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